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>
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Watch MrExcel Video

Forum statistics

Threads
1,102,145
Messages
5,484,990
Members
407,478
Latest member
wsupaul

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top