Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveSheet.Shapes("Rect2").Select
With Selection.Font .ColorIndex = 1 End With I use the code above to change the color of the text inside a rectangle and it works fine but what is the correct syntax to use without having to select the rectangle first. Thank you Thank you |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With ActiveSheet.Shapes("Rect2").Font
.ColorIndex = 1 End With Mike F "Ben" wrote in message ... ActiveSheet.Shapes("Rect2").Select With Selection.Font .ColorIndex = 1 End With I use the code above to change the color of the text inside a rectangle and it works fine but what is the correct syntax to use without having to select the rectangle first. Thank you Thank you |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That's what I thought should work but it doesn't . It produces a run-time
error "Object doesn't support this propery or method" "Mike Fogleman" wrote: With ActiveSheet.Shapes("Rect2").Font .ColorIndex = 1 End With Mike F "Ben" wrote in message ... ActiveSheet.Shapes("Rect2").Select With Selection.Font .ColorIndex = 1 End With I use the code above to change the color of the text inside a rectangle and it works fine but what is the correct syntax to use without having to select the rectangle first. Thank you Thank you |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveSheet.Shapes("Rect2").TextFrame.Characters.F ont.ColorIndex = 1
Ben wrote: ActiveSheet.Shapes("Rect2").Select With Selection.Font .ColorIndex = 1 End With I use the code above to change the color of the text inside a rectangle and it works fine but what is the correct syntax to use without having to select the rectangle first. Thank you Thank you -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Correct Syntax for Changing Color of Cell Based on Value | Excel Discussion (Misc queries) | |||
Font color changing by itself | Excel Discussion (Misc queries) | |||
Changing Font color based on font type or size | Excel Discussion (Misc queries) | |||
Font.Color - syntax error ? | Excel Programming | |||
VBA Help with changing shape color for selected shapes only | Excel Programming |