Sub E1D_Cliquer()
Echanger_couleur "E1G"
End Sub
Sub E1G_Cliquer()
Echanger_couleur "E1D"
End Sub
Sub Echanger_couleur(x As String)
' x est le nom de la forma avec laquelle échanger la couluer
Dim shp1 As Shape, shp2 As Shape
On Error GoTo ERR001
With ActiveSheet
Set shp1 = .Shapes(Application.Caller)
Set shp2 = .Shapes(x)
If shp1.Fill.ForeColor.RGB = RGB(255, 192, 0) Then
shp1.Fill.ForeColor.RGB = RGB(166, 166, 166)
shp2.Fill.ForeColor.RGB = RGB(255, 192, 0)
Else
shp2.Fill.ForeColor.RGB = RGB(166, 166, 166)
shp1.Fill.ForeColor.RGB = RGB(255, 192, 0)
End If
.Range("b2") = shp1.Name
End With
ERR001:
End Sub