Macro Help

  • Thread starter Thread starter stan
  • Start date Start date
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top