Maybe something like this
Sub test2()
Dim ctrHz As Double, ctrVt As Double
With ActiveSheet.Shapes("Line 1")
ctrHz = .Left + .Width / 2
ctrVt = .Top + .Height / 2
End With
With ActiveSheet.Shapes("Text Box 2")
.Left = ctrHz - .Width / 2
.Top = ctrVt - .Height / 2
End With
End Sub
You might want to format your textbox's Autosize property = true
Regards,
Peter T
"Richard" <(E-Mail Removed)> wrote in message
news:AB834888-C593-4BCE-A6B8-(E-Mail Removed)...
> I'm using a macro to drawing lines and then adding text labels to the
lines.
>
> The text has variable lengths. Right now I'm adding the text so that the
> left top of the text box corresponds to the 1/2 point of the line.
>
> How can I center theh text on a specific point (for example the 1/2 way
> point on a line)?
>
>
> --
> Richard
|