I can't quite figure out how to fix the following issue.
Background:
I made a userform to assist me in making timelines of various workstreams. Essentially it uses adds a shape of a certain length (duration) and some text to fill it in. Code snip that does that...
My issue is that if the duration entered in the form (length of the shape) is not long enough, the text that would go inside gets only partially shown.
If the duration is not long enough to encapsulate the words, put them out to the right.
I need the font to stay the same size so this is more about placement or allowing to spill than autofitting. I tied .WordWrap = False, but it doesn't seem to do it.
Is there a way to do this dynamically as part of the code or should I make it a choice on the userform instead?
Thanks as always for your expert help!
Background:
I made a userform to assist me in making timelines of various workstreams. Essentially it uses adds a shape of a certain length (duration) and some text to fill it in. Code snip that does that...
VBA Code:
If TaskCheck = True Then
Set s = ws.Shapes.AddShape(Type:=msoShapeRectangle, _
Left:=c.Left, _
Top:=c.Top, _
Width:=c.Width + Dur, _
Height:=c.Height)
s.Fill.ForeColor.RGB = RGB(R, G, B)
With s.TextFrame
.Characters.Text = tLabel
.Characters.Font.ColorIndex = 3
.Characters.Font.Color = RGB(0, 0, 0)
.Characters.Font.Name = "Century Gothic"
' .Characters.Font.FontStyle = "Bold"
.Characters.Font.Size = 12
.HorizontalAlignment = xlHAlignCenter
.VerticalAlignment = xlVAlignCenter
End With
s.Select
My issue is that if the duration entered in the form (length of the shape) is not long enough, the text that would go inside gets only partially shown.
- For example, a duration of 10 only shows the L for the text "Long Words Here"
- Longer durations show a little more until the duration is long enough to hold all the text.
If the duration is not long enough to encapsulate the words, put them out to the right.
I need the font to stay the same size so this is more about placement or allowing to spill than autofitting. I tied .WordWrap = False, but it doesn't seem to do it.
Is there a way to do this dynamically as part of the code or should I make it a choice on the userform instead?
Thanks as always for your expert help!