I've be working on a reporting macro based on Jerry Beaucaire's excellent FillOutTemplate macro.
The problem's I'm encountering (in attached simplified workboor are):
1) Dashboard selection: How can I make sure workbooks are only created for the flagged names in tab "Dashboard selection" ?
I would like reports to be created only for the names where in the tab "Dashboard selection" the "Report?" column = 1. If I use any method I know to create this selection on the Data tab (e.g. VLOOKUP) the fields where the VLOOKUP is empty/error also get parsed, so the macro returns an error.
2) Using different templates depending on dashboard: How can I get the macro to use different templates for different flags in the tab "Dashboard selection"? Everything I try to modify the existing macro gives parse errors (I'm duplicating the code for the template filling).
For example, for Name=Name1, because "Report?"=1 we need to create a report with 3 tabs:
Main-Name1 = tab "Template" filled with all fields
RepA = tab "Template-repA" filled with only the Address
Rep B = tab "Template- repB" filled with only the City
(no tab Rep C, because there is no flag in the dashboard)
3) Submacro's in template sheet: How can i get this macro to run a sub macro on the Template sheet?
For example, whenever the tab "Template_repA" gets added to a report I would like to run the macro "TestMacro" as present in the workbook. I tried adding the code to the overall macro, which works, but I would prefer to be able to "run"/"call" the seperate "TestMacro" macro from the FillOutTemplate macro, so I can have many different macro's per tab and only run them when necessary. Is this possible?
For reference I've attached the master workbook and a sample output file which it should generate (for Name1), but which I have been unable to generate automatically so far.
I've been playing around with this for a few days, but I'm afraid my excel programming skills fall short. Any help on one or more of these issues would be enormously appreciated!
Bookmarks