Add TextBox - determine position


Posted by Bruno on February 12, 2002 11:30 PM

I want to put a textbox on a sheet with vba using :

ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 50, 125, 100, 25)

But instead of the left-position (=50) ans the top-position (=125), I want to put the textbox above the active cell.

Any idea's ?

Posted by Ivan F Moala on February 12, 2002 11:51 PM

Sub AddTextBox()
Dim Left As Double, Top As Double

With ActiveSheet
Left = ActiveCell.Left
Top = ActiveCell.Top
.Shapes.AddTextBox msoTextOrientationHorizontal, Left, Top, 100, 25
End With


End Sub


HTH


Ivan



Posted by Bruno on February 13, 2002 12:00 AM

Thanks Ivan, life can be so easy . . .