CheekyDevil2386
New Member
- Joined
- Oct 19, 2020
- Messages
- 6
- Office Version
- 2013
- Platform
- Windows
HI experts!
Sorry for the simple question here but I've scoured pages looking for an answer with no luck.
All I'm trying to do is use the below loop code to set all the label forecolor properties to black. The code is contained within a larger With statement if that matters? The height and width work well, just not the forecolor:
It's also in a module, again if that makes any difference, and the labels are all on Sheet1.
Just can't seem to work out how to reference the labels on Sheet1 to change the text color. Any help is greatly appreciated!
Sorry for the simple question here but I've scoured pages looking for an answer with no luck.
All I'm trying to do is use the below loop code to set all the label forecolor properties to black. The code is contained within a larger With statement if that matters? The height and width work well, just not the forecolor:
It's also in a module, again if that makes any difference, and the labels are all on Sheet1.
VBA Code:
With Sheet1
On Error Resume Next
For l = 1 To 50
.Shapes("Label" & l).Height = 19.25
.Shapes("Label" & l).Width = 102.75
.Shapes("Label" & l).Forecolor = 0
Next l
End With
Just can't seem to work out how to reference the labels on Sheet1 to change the text color. Any help is greatly appreciated!