I am attempting to write vba code that will restore all the sheets except the "setup page" to its original state. After users setup their workbook, users will enter in data throughout the year and add rows to named tables as they need to enter a new entry. Then at the end of each year, they need to save it as that year, clear out the data, and restore all the tables to only three rows. This way it is then ready to add in data for the next year.
I wrote the first part of the code that is meant to clear out all unlocked cells (essentially clear out everything the user entered in for that year but keep what they entered into their setup page).
However, I get a next without for error. It highlights Nxt sheet and gives that error, but there is a for statement. For each sheet In Workbook . . . so maybe I nested incorrectly:
Then once I get that part of the code working, I need to add code that will restore all tables in all the worksheets (except the setup page) to three rows only (deleting all rows they added throughout the year). But I have no idea how to write that part of the code.Please Login or Register to view this content.
All the tables are named. On the Average Hire Rate worksheet, there is one table named hirerate. On the Quarter 1-Quarter 4 worksheets, there are five tables on each worksheet. They are named Service 1, Service 2, Service 3, Service 4, and Service 5 on quarter 1 sheet. On quarter 2 sheet, they are named Service2.1, Service2.2, Service2.3, Service2.4, Service2.5. Then quarter 3 sheet, they are named Service3.1, Service3.2 etc.
Bookmarks