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 27 28 29 30 31 32 33 34 35
| Function TraceCable(D As Double, MatCable As Variant, color As Variant) As Variant
Dim Shp As Shape
Dim coul As Long
Dim i As Long
Call trace_buse(D / 200, D / 200, D)
MatCable = Worksheets("Feuil1").Range("A2:C12") ' à adapter
For i = 1 To UBound(MatCable, 1)
Set Shp = Worksheets("Feuil1").Shapes.AddShape(msoShapeOval, MatCable(i, 2), MatCable(i, 3), MatCable(i, 1), MatCable(i, 1))
If color = rouge Then
coul = RGB(255, 0, 0)
Shp.Fill.ForeColor.RGB = coul
End If
If color = bleu Then
coul = RGB(0, 0, 255)
Shp.Fill.ForeColor.RGB = coul
End If
If color = vert Then
coul = RGB(0, 255, 0)
Shp.Fill.ForeColor.RGB = coul
End If
If color = jaune Then
coul = RGB(255, 255, 0)
Shp.Fill.ForeColor.RGB = coul
End If
If color = noir Then
coul = RGB(0, 0, 0)
Shp.Fill.ForeColor.RGB = coul
End If
If color = blanc Then
coul = RGB(255, 255, 255)
Shp.Fill.ForeColor.RGB = coul
End If
Next i
End Function |
Partager