Solved how to copy and insert entire column using macro?

February 24, 2015 at 21:40:39
Specs: Windows 7
I have a template in which columns are given montwise eg: Jan'15; Feb'15...etc.
I want to convert it into weekwise without changing the values under each month ie, values in the Jan '15 will be remain same in Week-1, week-2, week-3 & Week-4 of Jan'15,

See More: how to copy and insert entire column using macro?

Report •

February 25, 2015 at 06:56:40
✔ Best Answer
Assuming January to December in columns 1 to 12, this code will create 4 copies of each monthly column, e.g. January in columns 1 to 4, February in columns 5 to 8, etc.

If this is not what you are looking for, let us know.

Sub MonthsToWeeks()
'Loop to set variable for each month.
   For mNum = 1 To 48 Step 4
'Loop to Copy/Insert 3 copies of Month Column
     For wCol = mNum To mNum + 2
       Columns(wCol + 1).Insert Shift:=xlToRight
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

February 28, 2015 at 19:56:15
Thanks a lot.. It works well

message edited by Shejin

Report •
Related Solutions

Ask Question