View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Bundy John Bundy is offline
external usenet poster
 
Posts: 772
Default Change every 3 columns width with code

Here you go, place in the sheets code, change 100 to what column you want to
stop at:
Sub main()

For i = 1 To 100 Step 3
Columns(i).ColumnWidth = 6
Columns(i + 1).ColumnWidth = 7
Columns(i + 2).ColumnWidth = 1

Next
End Sub
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Les Stout" wrote:

Hi all, i have an automated spread sheet that i need to change the
column widths to the following with code...

A=6, B=7 & C=1...

It must carry on with D=6, E=7 & F=1... doing the width of the data on
the spreadsheet...

Any help would be welcomed...

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***