Question

How can I set columns number for the textbox in VBA for Excel? (excel located -> format shape -> text box -> columns). I have tried to look all over internet and office help but i can find only read only property column on the text box. I use Office 2010

Was it helpful?

Solution

I just recorded a macro, and it came up with this:

    ActiveSheet.Shapes.Range(Array("TextBox 1")).Select
    Selection.ShapeRange.TextFrame2.Column.Number = 2

OTHER TIPS

After a cut-n-paste from a Word doc, I found I had a text box called "Text Box 1". One line (demo for the immediate window) shows the number of columns :
? Sheets(1).Shapes("Text Box 1").TextFrame2.Column.Number

and FWIW the text in the box is :
? Sheets(1).Shapes("Text Box 1").TextFrame.Characters.Text

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top