PDA

View Full Version : Inserting columns using VBA



Phoenix1
04-15-2012, 04:01 AM
I have a lot of tables of information on one worksheet. Each table is separated by an empty column. I need to be able to write a code that will insert an extra column between each table. All tables are 8 columns wide and use 50 rows. Can anyone help please?

Bob Phillips
04-15-2012, 11:50 AM
Off the top


With Activesheet

lastcol = .Cells(1, .Columns.Count).End(xlToLeft).Column
For i = lastcol - 8 to 9 Step -1

.Columns(i).Insert
Next i
End With