Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RE: Excel Automation how do I resize a column? 1

Status
Not open for further replies.

AaronA

Programmer
Sep 27, 2000
21
US
I am trying to do some Excel Automation. I need to be able to change the width of a column in the Excel Workbook. Any Ideas on how to do that? I have tried this:

Workbook.Range("A1").Width = 12

do you see what I am trying to do? It tells me something about an object is required, but I am trying to set a number, not an object. I have also tried using the column property, but gives an error as well. Hope someone can help. Thanks
 
Application.Columns("A:A").ColumnWidth = 12

Hint: Tools / Macro / Record New Macro
move column 1 border
Stop record
Tools / Macro / Macros / select / Edit
Look at generated code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top