Greetings, I'm currently running this code when the sheet deactivates to delete empty rows from a worksheet:
The problem is, if there are less than two records in the worksheet, it will delete the heading row, breaking my dynamic named ranges and tables based on same.
I tried adding a check like this:
But this doesn't seem to work. Appreciate code / ideas to help!
EDIT: I should add that a new row is generated automatically when the last record has been completed, in anticipation of the user needing to enter another record. But if they don't actually need to enter anything, then I have to remove that blank row so that my dynamic named ranges don't include it in the range, thus messing up tables/pivot tables.
Bookmarks