David Cuthill
unread,Oct 6, 2021, 1:32:50 PM10/6/21You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I have several chartsheets that I am creating and in each I add textboxes. Each text box is the same dimensions but the length of text varies. I thought as I write the text into the textbox I could use the msoAutoSizeTextToFitShape setting and the text (font size) would adjust to allow the complete length of the text to fit within the width of the shape.
This is what I am using ....
ActiveChart.Shapes.AddTextbox(msoTextOrientationHorizontal, 550, _
50, 119, 18).Name = "textbox1"
With ActiveChart.TextBoxes("textbox1")
.ShapeRange.TextFrame2.wordwrap = msoFalse
.ShapeRange.TextFrame2.AutoSize = msoAutoSizeTextToFitShape
.Text = "Sand Loading - " & Format(Cs_PPA_o, "#.00") '"=Sheet1!a5"
With .Font
.Name = "Calibri"
End With
End With
The font size does not change to fit the shape.