RawlinsCross
Active Member
- Joined
- Sep 9, 2016
- Messages
- 402
I want to turn 10 shapes (arrows and connecting lines) to .Transparency = 1 when a certain condition exists. There are 10 shapes named "CS_AC1".... though to ... "CS_AC10".
How do I cycle through them instead of listing each one separately:
Condition Then
Worksheets("Dashboard").Shapes.Range(Array("CS_AC1")).Select
Application.CommandBars("Format Object").Visible = False
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 0, 0)
.Transparency = 1
End With
Worksheets("Dashboard").Shapes.Range(Array("CS_AC2")).Select
Application.CommandBars("Format Object").Visible = False
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 0, 0)
.Transparency = 1
End With
Worksheets("Dashboard").Shapes.Range(Array("CS_AC3")).Select
Application.CommandBars("Format Object").Visible = False
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 0, 0)
.Transparency = 1
End With
..............etc.
How do I cycle through them instead of listing each one separately:
Condition Then
Worksheets("Dashboard").Shapes.Range(Array("CS_AC1")).Select
Application.CommandBars("Format Object").Visible = False
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 0, 0)
.Transparency = 1
End With
Worksheets("Dashboard").Shapes.Range(Array("CS_AC2")).Select
Application.CommandBars("Format Object").Visible = False
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 0, 0)
.Transparency = 1
End With
Worksheets("Dashboard").Shapes.Range(Array("CS_AC3")).Select
Application.CommandBars("Format Object").Visible = False
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 0, 0)
.Transparency = 1
End With
..............etc.