Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
print problem font size abbyalex New Users to Excel 1 February 4th 08 08:30 PM
Excel 2003 - setting the Comment font size default rickz Excel Worksheet Functions 3 July 16th 07 03:53 AM
How to change the default setting for font and size? Eric Excel Discussion (Misc queries) 5 May 13th 06 05:12 PM
setting up default font size in comments Jorge Setting up and Configuration of Excel 1 March 1st 06 12:03 PM
Has anyone had problems setting the font size for a title through VBA? Viv2004 Charts and Charting in Excel 4 August 28th 05 12:23 PM


All times are GMT +1. The time now is 09:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"