Custom Text - Alignment
Posted: Wed Oct 09, 2013 9:26 pm
I'm using this code to add custom text to my chart:
This is in a loop that adds 3 lines (each in separate shapes).
I'm trying to get them to Right Align with each other, but the above code does not do that. I also tried moving .TextAlignment = taRightJustify above the .shape block, but that doesn't work, either.
How can I fix this code -- or is there a better way, entirely, to add 3 lines of numbers to the chart and have the numbers right aligned to each other?
Code: Select all
.Tools.Add tcAnnotate
With .Tools.Items(ctr - 1)
.Active = True
With .asAnnotation
.Top = (intRecTop + 5) + (intTextHeight * (ctr - 1))
.Left = intRecLeft
With .Shape
.TextAlignment = taRightJustify
.Transparent = True
.Transparency = 100
.ShapeStyle = fosSquareRectangle
.Font.Color = vbBlue
End With
.Text = Format(macurMoTotals(ctr), "$#,##0")
End With
End With
I'm trying to get them to Right Align with each other, but the above code does not do that. I also tried moving .TextAlignment = taRightJustify above the .shape block, but that doesn't work, either.
How can I fix this code -- or is there a better way, entirely, to add 3 lines of numbers to the chart and have the numbers right aligned to each other?