I have a master dashboard that has been generated using the entire company's sales data (all business units).
I need to create multiple workbooks from this master for each business unit with only their data.
My requirement is similar to what's discussed here
http://chandoo.org/forum/threads/split-multiple-workbooks.24480/#post-147414
However, a few reasons why I wasn't able to use the solution mentioned in that are:-
1. My master workbook is a full dashboard having a lot of pivots, charts etc.
2. The data is an excel table in a sheet. However, there is some content on top of that excel table as well.
3. I need rows deleted rather than copied.
What I need to do is this through VBA:-
Have a separate file called say "Dashboard Splitter.xlsx" (I can put all the BU names in a list on this one if required) with a Macro that does the following:-
1. Take the Master Dashboard file
2. For each BU (BU is the first column in the data table in the Master Dashboard)
2a. Make a copy of the Excel file with BU Name as prefix
In the new excel file...
2b. Clear filter if any on the data table
2c. Select all rows in the data table except the ones for the selected BU
2d. Delete those rows
2e. Refresh the Pivots
1. Repeat steps 1 & 2 for next BU until all BUs are done
In the end I should have a dashboard for each of the BUs with just their data.
Attached is a sample file.
I need to create multiple workbooks from this master for each business unit with only their data.
My requirement is similar to what's discussed here
http://chandoo.org/forum/threads/split-multiple-workbooks.24480/#post-147414
However, a few reasons why I wasn't able to use the solution mentioned in that are:-
1. My master workbook is a full dashboard having a lot of pivots, charts etc.
2. The data is an excel table in a sheet. However, there is some content on top of that excel table as well.
3. I need rows deleted rather than copied.
What I need to do is this through VBA:-
Have a separate file called say "Dashboard Splitter.xlsx" (I can put all the BU names in a list on this one if required) with a Macro that does the following:-
1. Take the Master Dashboard file
2. For each BU (BU is the first column in the data table in the Master Dashboard)
2a. Make a copy of the Excel file with BU Name as prefix
In the new excel file...
2b. Clear filter if any on the data table
2c. Select all rows in the data table except the ones for the selected BU
2d. Delete those rows
2e. Refresh the Pivots
1. Repeat steps 1 & 2 for next BU until all BUs are done
In the end I should have a dashboard for each of the BUs with just their data.
Attached is a sample file.