View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Arawn Arawn is offline
external usenet poster
 
Posts: 10
Default Cycle thru & format all columns

I need to cycle thru each column, autofit it, and add 2 character
spaces.

My current code is:

Cells.Select
Selection.EntireColumn.Hidden = False
Selection.EntireRow.Hidden = False

Cells.EntireColumn.AutoFit
Range("A1").Select
Wide = Selection.ColumnWidth
Selection.ColumnWidth = Wide + 2
Range("B1").Select
Wide = Selection.ColumnWidth
Selection.ColumnWidth = Wide + 2
Range("C1").Select
Wide = Selection.ColumnWidth
Selection.ColumnWidth = Wide + 2
Range("D1").Select
Wide = Selection.ColumnWidth
Selection.ColumnWidth = Wide + 2

Etc, etc, etc, all the way to

Range("IV1").Select
Wide = Selection.ColumnWidth
Selection.ColumnWidth = Wide + 2

Although this is functional, it looks like a mess. Any help in
cleaning it up would be greatly appreciated.

~Arawn