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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,550
Messages
5,512,016
Members
408,872
Latest member
Lorid24

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top