Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 On Feb 21, 6:04*pm, stan wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |