Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50090

Deleting a TextBox (TextFrame)

$
0
0
Help needed, please...

I have the following VBA code that generates a textbox in an Excel spreadsheet:

Code:

Dim TBox1 As TextFrame
Dim boxLeft As Double, boxTop As Double
boxLeft = currentcell.Left
boxTop = currentcell.Top
      ' Create text box.
      Set TBox1 = Worksheets("Printcopy").Shapes.AddTextBox _
      (Orientation:=msoTextOrientationHorizontal, _
      Left:=boxLeft + 2, Top:=boxTop, Width:=640.5, Height:=702.75).TextFrame

All works well - but what I now need to do is be able to delete this box in code too - but no matter what i try, I get errors.

Any help is appreciated!




Moderator's Note: Welcome to the forum. Codes are supposed to be enclosed with code tags. Select he code then hit "#" sign. I'll do it for now thank you.

Viewing all articles
Browse latest Browse all 50090

Trending Articles