Thanks for the help guys.
By the way, when you write the code as:
And not as:Code:Set oShp = ActiveSheet.Shapes("Rectangle 1") oShp.TextFrame.Characters.Font.ColorIndex = 5 'Change the rectangles text to blue
What's the main reason for declaring a variable rather than just using the actual object reference? Is the code faster or is it just 'tidier' to use a variable? I have tended to use the full object reference in the past but noticed that most of you declare variables wherever possible.Code:ActiveSheet.Shapes("Rectangle 1" _ .TextFrame.Characters.Font.ColorIndex = 5 'Change the rectangles text to blue





Reply With Quote