We are automating Excel using VB.Net, and trying to place multiple lines of text on an Excel worksheet that we can set to not print. Between these we would have printable re
When you copy & paste a textbox, Excel will place the new textbox over whichever cell is currently selected. So you can achieve this very easily by simply using the VBA copy & paste commands. This can be particularly useful if you are going to be using a lot of very similar textboxes, as you are effectively creating a textbox template.
If you have the cell name or position, you can do:
With ActiveSheet
.Shapes.AddTextbox msoTextOrientationHorizontal, .Cells(3,2).Left, .Cells(3,2).Top, .Cells(3,2).Width, .Cells(3,2).Height
End With
This will add a textbox over cell B3. When B3 is resized, the textbox is also.