I have a workbook which has a hidden worksheet named 'Template'. There is some code that creates new worksheets based on criteria in the Summary worksheet, so if you run the macro called CreateSheets, it will create new worksheets for every code which has a 'Complete' status on the Summary sheet, putting the relevant code in cell C5 on the newly created sheets and giving the worksheet the same name as the code.
On these newly created sheets are some SUMIFS formula to sum values (see very simplified sample attached). The values in cells E10:E19 (always the same range) change based on the entry in cell C5 and this results in the values in some cells in E10:E19 being zero.
What I want to happen is that when the new worksheets are generated any rows in the range E10:E19 on each newly created sheet that show zero are automatically deleted. So on the attached sample:
on sheet AB123, rows 10, 13, 15 and 19 would be deleted
on sheet XZ689 rows 11, 14, 15, 18 and 19 would be deleted
on sheet PQ792 rows 13, 14, 16, 17 and 18 would be deleted and so on for each sheet
Is there a way to achieve this by adding to the code?
The code to generate the new worksheets, kindly created by skywriter is:
Many thanksPlease Login or Register to view this content.
Bookmarks