View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default Code to change column widths?

Sub tryme()
Application.ScreenUpdating = False
For Each wk In Worksheets
Columns.ColumnWidth = 15
Next
Application.ScreenUpdating = True
End Sub

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"BABs" wrote in message
...
I am running code to open a workbook and then I want to set all columns in
the workbook to 15.
I use:
.Workbooks.Open "C:\Shared\Report Info.xlsx"
.Columns.ColumnWidth = 15
This code only works on the first sheet in the workbook, but I need it to
work for all sheets.
Can someone please help me?
TIA