Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Set shp = ActiveSheet.Shapes.AddShape(msoShapeRectangle, 10, 10, 50, 50)
With shp … .Fill.ForeColor.RGB = RGB(255, 255, 255) … .TextFrame.Characters.Font.Color = RGB(0, 0, 0) … End With The code: .TextFrame.Characters.Font.Color = RGB(0, 0, 0) gives results <grey not <black why ? is there any syntax error ? Many thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That looks fine to me on the basis of what you've posted.
Guessing, at the time you apply the font colour does your shape have a textframe and text. If not the code would error possibly masked if under on error resume next. Thereafter the font colour would remain same as your default for new shapes. If(?) that's what your doing, eg an empty text box with font pre-formatted, there's another way. Set shp = ActiveSheet.Shapes.AddTextbox(msoShapeRectangle, _ 10, 10, 50, 50) With shp .Fill.ForeColor.RGB = RGB(255, 255, 255) .DrawingObject.Font.Color = RGB(255, 0, 0) 'red for testing .Visible = True ' or '.DrawingObject.Font.ColorIndex = xlAutomatic '3 for red .Select End With This should add an empty text box and select, now type in some text. Regards, Peter T PS, although .forecolor can be RGB formatted with any one of 16 million colours, font can only accept one of the 56 palette colours or automatic, when applying an rgb the closest match in the palette will be applied. "Linda Edlund" wrote in message 7... Set shp = ActiveSheet.Shapes.AddShape(msoShapeRectangle, 10, 10, 50, 50) With shp … .Fill.ForeColor.RGB = RGB(255, 255, 255) … .TextFrame.Characters.Font.Color = RGB(0, 0, 0) … End With The code: .TextFrame.Characters.Font.Color = RGB(0, 0, 0) gives results <grey not <black why ? is there any syntax error ? Many thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much Peter
I've missed this information about 56 colours available for font.color I had change <black in my pallete to some other colour earlier, so it was the risen Now it's fixed Thanks again |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Format for font color using font color | Excel Worksheet Functions | |||
Changing Font color based on font type or size | Excel Discussion (Misc queries) | |||
How to change the default Border, Font Color, and Cell Color | Excel Discussion (Misc queries) | |||
My fill color and font color do not work in Excel Std Edition 2003 | Excel Discussion (Misc queries) | |||
VBA syntax for Font & Interior ColorIndex | Excel Discussion (Misc queries) |