Vba - find next empty column, insert column, copy paste values & copy paste formulas

DoodlesMama

New Member
Joined
Aug 26, 2012
Messages
14
I am creating a report that will be updated monthly then create charts with the newly pulled data.
I need to create code that will:

  • find last column that contains data
  • copy & paste values of that column (within that same column)
  • find the next available blank column and insert a new column
  • copy the master formula column
  • paste formulas in the newly inserted column
  • calculate
  • Hide any columns older than 6 months.



DATES BELOW NEED TO CALCULATE TODAY'S DATE THEN POPULATE THE PREVIOUS MONTH'S FIRST & LAST DAY</SPAN>

MONTH START</SPAN>

11/1/2012</SPAN>​

MONTH END</SPAN>

11/30/2012</SPAN>​

<-----NEED TO HIDE------></SPAN>​

COPY PASTE VALUES</SPAN>​

INSERT NEW COLUMN</SPAN>​
MASTER FORMULAS</SPAN>

DAYS</SPAN>​

31</SPAN>​

29</SPAN>​

31</SPAN>​

30</SPAN>​

31</SPAN>​

30</SPAN>​

31</SPAN>​

31</SPAN>​

30</SPAN>​

31</SPAN>​

30</SPAN>

FORMULA</SPAN>​

START</SPAN>​

1/1/12</SPAN>​

2/1/12</SPAN>​

3/1/12</SPAN>​

4/1/12</SPAN>​

5/1/12</SPAN>​

6/1/12</SPAN>​

7/1/12</SPAN>​

8/1/12</SPAN>​

9/1/12</SPAN>​

10/1/12</SPAN>​

11/1/12</SPAN>

FORMULA</SPAN>​

END</SPAN>​

1/31/12</SPAN>​

2/29/12</SPAN>​

3/31/12</SPAN>​

4/30/12</SPAN>​

5/31/12</SPAN>​

6/30/12</SPAN>​

7/31/12</SPAN>​

8/31/12</SPAN>​

9/30/12</SPAN>​

10/31/12</SPAN>​

11/30/12</SPAN>
FORMULA</SPAN>

DATE RANGE</SPAN>

Jan 1 - 31, 2012</SPAN>​

Feb 1 - 29, 2012</SPAN>​

Mar 1 - 31, 2012</SPAN>​

Apr 1 - 30, 2012</SPAN>​

May 1 - 31, 2012</SPAN>​

Jun 1 - 30, 2012</SPAN>​

Jul 1 - 31, 2012</SPAN>​

Aug 1 - 31, 2012</SPAN>​

Sep 1 - 30, 2012</SPAN>​

Oct 1 - 31, 2012</SPAN>​

Nov 1 - 30, 2012</SPAN>​
FORMULA</SPAN>

DATA TYPE1</SPAN>

1024</SPAN>​

1038</SPAN>​

1048</SPAN>​

1060</SPAN>​

1063</SPAN>​

1069</SPAN>​

1182</SPAN>​

1196</SPAN>​

1206</SPAN>​

1217</SPAN>​

1224</SPAN>​

FORMULA</SPAN>​

DATA TYPE2</SPAN>

332</SPAN>​

339</SPAN>​

301</SPAN>​

284</SPAN>​

339</SPAN>​

353</SPAN>​

497</SPAN>​

565</SPAN>​

594</SPAN>​

648</SPAN>​

532</SPAN>​

FORMULA</SPAN>​

DATA TYPE3</SPAN>

296</SPAN>​

291</SPAN>​

249</SPAN>​

248</SPAN>​

278</SPAN>​

301</SPAN>​

403</SPAN>​

492</SPAN>​

520</SPAN>​

593</SPAN>​

478</SPAN>​
FORMULA</SPAN>

<TBODY>
</TBODY>
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,214,628
Messages
6,120,618
Members
448,973
Latest member
ChristineC

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