Re
Quel est le code ?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = False
If Not Application.Intersect(Target, Range("M2")) Is Nothing Then
If Target.Value = "" Then
With Target
.Value = Chr(168)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Name = "Wingdings"
.Font.Size = 18
End With
With Target.Offset(0, 1)
.Value = "Toutes références"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
On Error Resume Next
ElseIf Target.Value = Chr(168) Then
With Target
.Value = Chr(254)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Name = "Wingdings"
.Font.Size = 18
End With
With Target.Offset(0, 1)
.Value = "Stock disponible"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
For Ligne = Cells(Rows.Count, "B").End(xlUp).Row To 3 Step -1
If Cells(Ligne, "E") = "" Then Rows(Ligne).Hidden = True
Next Ligne
On Error Resume Next
ElseIf Target.Value = Chr(254) Then
With Target
.Value = Chr(168)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Name = "Wingdings"
.Font.Size = 18
End With
With Target.Offset(0, 1)
.Value = "Toutes références"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
For Ligne = Cells(Rows.Count, "B").End(xlUp).Row To 3 Step -1
If Cells(Ligne, "E") = "" Then Rows(Ligne).Hidden = False
Next Ligne
'Target.Offset(0, 0).Select
End If
End If
last = Range("B" & Rows.Count).End(xlUp).Row
If Not Application.Intersect(Target, Range("G3:G" & last)) Is Nothing Then
With Range("A3:J" & last).Borders
.LineStyle = xlContinuous
.Weight = xlThin
End With
For i = 3 To last
If Cells(i, 3) = "" Then
Cells(i, 3) = "/"
End If
Next i
End If
End Sub