Macro Help

S

stan

Hello,

I'm trying to create a macro so that two columns are inserted every 12
columns starting with Column C. Any help would be appreciated.

Thanks.
 
P

Pete_UK

Here's one I've just recorded for you:

Sub Macro1()
Dim i As Integer
Range("C1").Select
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Insert Shift:=xlToRight
For i = 1 To 10
ActiveCell.Offset(0, 12).Columns("A:B").EntireColumn.Select
Selection.Insert Shift:=xlToRight
Next i
End Sub

This will insert two new columns C and D, then move 12 columns over
from the new columns and repeat 10 times. Just change the 10 and/or 12
to suit.

Hope this helps.

Pete
 
Top