really weird behavior, chart with textbox font size problem

X

xlrotor

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top