Hi,
I'm trying to make a Macro to copy a column and insert it next to the last column pasted.
This so I can add a new day to the data i.e. sales data for the first is in column c. Month totals are in column D.
I want to copy the formula in column C and insert them into column D. The month total moves to column E.
The next time the Macro runs column D should be copied and inserted into column E and so on.
Alternatively column C could be copied and inserted over and over but I'm not sure how to change the code to add 1 each time.
I would be grateful for any assistance
My code so far is:
Sub AddColumns ()
Columns("C:C").Select
Selection.Copy
Columns("D:D").Select
Columns("C:C").Select
Selection.Insert Shift:=xlToRight
Range("D5:D13,D17:D34").Select
Range("D17").Activate
ActiveWindow.SmallScroll Down:=-27
Application.CutCopyMode = False
Selection.ClearContents
End Sub
I'm trying to make a Macro to copy a column and insert it next to the last column pasted.
This so I can add a new day to the data i.e. sales data for the first is in column c. Month totals are in column D.
I want to copy the formula in column C and insert them into column D. The month total moves to column E.
The next time the Macro runs column D should be copied and inserted into column E and so on.
Alternatively column C could be copied and inserted over and over but I'm not sure how to change the code to add 1 each time.
I would be grateful for any assistance
My code so far is:
Sub AddColumns ()
Columns("C:C").Select
Selection.Copy
Columns("D:D").Select
Columns("C:C").Select
Selection.Insert Shift:=xlToRight
Range("D5:D13,D17:D34").Select
Range("D17").Activate
ActiveWindow.SmallScroll Down:=-27
Application.CutCopyMode = False
Selection.ClearContents
End Sub