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 |
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 |
All times are GMT +1. The time now is 10:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com