Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem setting font size
How do you set the font size for the following?
Set sShape = worksheet.AddShape(msoShapeRectangle, left, top, width, height) With sShape .Fill.Transparency = 1# .Line.Transparency = 1# With .TextFrame .Characters.Text = label .HorizontalAlignment = xlHAlignCenter .VerticalAlignment = xlVAlignCenter End With End With Adding .Characters.Font.Size = 6 causes an error and using .AddLabel I can set font size but can not center align the text. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem setting font size
Good Morning Edward,
Set sShape = worksheet.AddShape(msoShapeRectangle, left, top, width, height) With sShape .Fill.Transparency = 1# .Line.Transparency = 1# With .TextFrame .Characters.Text = label .HorizontalAlignment = xlHAlignCenter .VerticalAlignment = xlVAlignCenter End With End With Adding .Characters.Font.Size = 6 causes an error and using .AddLabel I can set font size but can not center align the text. I think the error is caused by your with command... because .TextFrame.Characters.Font.Size won't be the right address. Try Shapes.Characters.Font.Size = 25 Best Markus |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem setting font size
Markus
Through much trial and error. Lots of error. I finally got it to work by including the following cText object. Dim sShape As Shape Dim cText As Characters ' Added Set sShape = worksheet.AddShape(msoShapeRectangle, left, top, width, height) With sShape .Fill.Transparency = 1# .Line.Transparency = 1# With .TextFrame .Characters.Text = label .HorizontalAlignment = xlHAlignCenter .VerticalAlignment = xlVAlignCenter End With End With Set cText = sShape.TextFrame.Characters ' Added cText.Font.Size = 6 ' Added Thanks for your suggestion. Ed *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
print problem font size | New Users to Excel | |||
Excel 2003 - setting the Comment font size default | Excel Worksheet Functions | |||
How to change the default setting for font and size? | Excel Discussion (Misc queries) | |||
setting up default font size in comments | Setting up and Configuration of Excel | |||
Has anyone had problems setting the font size for a title through VBA? | Charts and Charting in Excel |