1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Public Sub ColorByRegion()
Dim T, region$
region = Trim(Replace(Application.Caller, "Région", ""))
With Sheets("Départements"): T = .Range("A3:G" & .Cells(Rows.Count, 1).End(xlUp).Row).Value: End With
For i = LBound(T) To UBound(T)
If Trim(T(i, 7)) = region Then
With Sheets("Carte").Shapes(T(i, 5))
.Fill.ForeColor.RGB = ThisWorkbook.Colors(T(i, 6))
.Fill.Visible = msoTrue
.Fill.Solid
Debug.Print T(i, 5) & " : " & T(i, 6)
End With
End If
Next
End Sub
'
'
Public Sub Blanco()
Dim shap
For Each shap In Sheets("Carte").Shapes
If shap.Name Like "Freeform*" Then
shap.Fill.ForeColor.RGB = vbWhite
'shap.Line.ForeColor.RGB = RGB(100, 100, 100)
End If
Next
End Sub |
Partager