I am just a novice. I hope this is not too complex a solution.
I am trying to save data into an array that is date specific. I hope the following describes the problem.
Data Structure
1. The file is saved each day with a unique filename (the file is opened, SAVE-AS, and then the macros are run).
2. The pivot table in sheet PVT Summary is updated each day when the macro is run.
3. Using columns A and B in Sheet WIPHistory I capture the data from the pivot table in PVT summary. I use vlookup to capture the data.
Problem 1
1. I want to insert the data from Sheet "WIPHistory" Column B to before column D (moving all of the existing data to the right)
2a. The insert needs to paste the values.
Problem2
1. Column A in WIPHistory is set up to look at the current month and the last 3 months (in descending order)
2. When the month changes, the dates in Column A will change.
2a. This will make all of the existing data in Columns D through AF out of sync with the date in Column A.
3. Before copying and inserting the data from Column B to before Column D in WIPHistory, I need to make sure the month has not changed.
4. When the month does change, I need to "move" the existing data to stay in sync with their original date.
4a. That is, insert the correct number of rows in columns D through AH to move what is currently in row 4 to the row that matches the last day of the previous month.
SEE WORKSHEET WIPHistory2
The WIPHistory should look like "WIPHistory3" after the macro runs on 11/1/2014.
SEE WORKSHEET WIPHistory3
Concerns
1. Note that the dates in the column headings is not sequential. Some dates will be missing (the update is not done every day).
2. I do not need to truncate the columns automatically (I can do this manually), but it would be nice if the macro just cleared all of the data after column AH
3. I do not need to delete all of the rows that fall below the "new" bottom of the dates in column A automatically, but it would be nice if the macro would do that.
Bookmarks