stirlingmw
Board Regular
- Joined
- Feb 18, 2013
- Messages
- 75
Morning All
I have a workbook with 28 Worksheets. 11 of these sheets have a shape border ("Rounded Rectangle 21") I am trying to change the colour of all of the 11 "Rounded Rectangle 21" shapes dependant on a selection within sheet1 cell H6 which either changes the border blue or red. The code I initially found I thought worked, but this now does not seem to be the case.
This code is:
I have tried this with both worksheet and selection change. I have even tried adding the with selection section to each shape select.
Any ideas?
Thanks
Steve
I have a workbook with 28 Worksheets. 11 of these sheets have a shape border ("Rounded Rectangle 21") I am trying to change the colour of all of the 11 "Rounded Rectangle 21" shapes dependant on a selection within sheet1 cell H6 which either changes the border blue or red. The code I initially found I thought worked, but this now does not seem to be the case.
This code is:
VBA Code:
If Not Intersect(Target, Range("H6")) Is Nothing Then
If Target.Value = "UK SECRET" Or Target.Value = "SECRET" Then
Sheet1.Shapes("Rounded Rectangle 21").Select
Sheet2.Shapes("Rounded Rectangle 21").Select
Sheet3.Shapes("Rounded Rectangle 21").Select
Sheet4.Shapes("Rounded Rectangle 21").Select
Sheet5.Shapes("Rounded Rectangle 21").Select
Sheet6.Shapes("Rounded Rectangle 21").Select
Sheet7.Shapes("Rounded Rectangle 21").Select
Sheet8.Shapes("Rounded Rectangle 21").Select
Sheet9.Shapes("Rounded Rectangle 21").Select
Sheet10.Shapes("Rounded Rectangle 21").Select
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 0, 0)
.Transparency = 0
End With
else
'same code with different RGB
I have tried this with both worksheet and selection change. I have even tried adding the with selection section to each shape select.
Any ideas?
Thanks
Steve