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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specific Column Width

Status
Not open for further replies.

khansen97

Programmer
Oct 14, 2003
60
US
Anybody have any code to set a width of a column to a certain value?

I tried the following and it didn't work:

ActiveSheet.Columns("A:A").EntireColumn.Width = 19

thanks!
 

Use the macro recorder!

Code:
Columns("A:A").ColumnWidth = 19
 
khansen97,
Width is a read-only property of the range. It is returned in points.

ColumnWidth is a read/write property of the range. It is the number of standard width characters (like a 0) in the normal style that will fit.

As a fine point, Width can be added up for several columns and the results are the same as a single column having the same apparent (by eye) width. The same cannot be said for the sum of ColumnWidth, which will be a little less than for a single column having the same apparent width.
Brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top