Copy a column and insert it next to the last column copied

Shamos

New Member
Joined
Jun 27, 2013
Messages
11
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
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,216,756
Messages
6,132,529
Members
449,733
Latest member
Nameless_

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top