I'm putting together a spreadsheet template with multiple tabs (analysis, pivot table, data1, data2). Each time the data is updated, the contents of data1 and data2 need to be cleared, without deleting the header row (row 2). Since this is a template which will be used by my co-workers, I can't guarantee they're starting from a fresh file each time. And, if they're overwriting a file which already has data, I can't know if there's data in both data tabs. I've been trying to write if, then code but what I've come up with either does nothing or deletes the header.
A summary of what I need to do:
A summary of what I need to do:
- check if there's data below row 2 in the data1 tab. If yes, clear everything from A2 to V last row of data. If no, do nothing in that tab. For yes or no, continue
- repeat the above for the data2 tab
- end macro