Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
really weird behavior, chart with textbox font size problem
I'm using Excel 2003 SP2
I have an embedded xy scatter chart with a few textboxes on it. I'm trying to apply the same font size to all elements of the chart. Trying to do this from Excel user interface does not work. Using a macro also does not work, sort of. Excel seems to insist on making the font size of the textboxes close to double the rest of the chart. Sub Macro1() Selection.AutoScaleFont = False With Selection.Font .Size = 6 End With End Sub The above macro does not work with either True or False for the autoscalefont setting. Here's where it get really weird. The following macro does work by toggling the autoscale property, but only every other time I run it. When it works, the msgbox displays True. Sub Macro1() Selection.AutoScaleFont = Not Selection.AutoScaleFont With Selection.Font .Size = 6 End With MsgBox Selection.AutoScaleFont End Sub I just got an idea, and the following macro does work every time I run it. Sub Macro1() Selection.AutoScaleFont = False With Selection.Font .Size = 6 End With Selection.AutoScaleFont = True With Selection.Font .Size = 6 End With End Sub The Autosize setting of the textboxes doesn't seem to have anything to do with this. Is this behavior by design? Or is there some property of the chart or textboxes that makes this happen? Thanks, Brian Murphy Austin, Texas |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
really weird behavior, chart with textbox font size problem
Maybe someone in the Charts news group could answer your question.
"xlrotor" wrote: I'm using Excel 2003 SP2 I have an embedded xy scatter chart with a few textboxes on it. I'm trying to apply the same font size to all elements of the chart. Trying to do this from Excel user interface does not work. Using a macro also does not work, sort of. Excel seems to insist on making the font size of the textboxes close to double the rest of the chart. Sub Macro1() Selection.AutoScaleFont = False With Selection.Font .Size = 6 End With End Sub The above macro does not work with either True or False for the autoscalefont setting. Here's where it get really weird. The following macro does work by toggling the autoscale property, but only every other time I run it. When it works, the msgbox displays True. Sub Macro1() Selection.AutoScaleFont = Not Selection.AutoScaleFont With Selection.Font .Size = 6 End With MsgBox Selection.AutoScaleFont End Sub I just got an idea, and the following macro does work every time I run it. Sub Macro1() Selection.AutoScaleFont = False With Selection.Font .Size = 6 End With Selection.AutoScaleFont = True With Selection.Font .Size = 6 End With End Sub The Autosize setting of the textboxes doesn't seem to have anything to do with this. Is this behavior by design? Or is there some property of the chart or textboxes that makes this happen? Thanks, Brian Murphy Austin, Texas |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Weird chart window size problem in XL07 | Charts and Charting in Excel | |||
UserForm TextBox Font Size | Excel Programming | |||
Chart Auto-Size Behavior | Excel Programming | |||
textbox font size | Excel Worksheet Functions | |||
Change font and size of a textbox | Excel Programming |