Hello,
I want to write a code that searches my workbook for a table named 'DATA_CONSOL' then changes the name of that table to 'DATA_CONSOL_OLD'.
(ideally, the code would work so that if I run it multiple times, the first time it would rename the existing table to DATA_CONSOL_OLD, and the second time it would rename it to a unique name (e.g. DATA_CONSOL_OLD_2), then so on and so forth. However, if there is no table named 'DATA_CONSOL' in the workbook, it'd move to the next action in the code (since there'd be nothing to rename)
Is this possible?
Context (if you care):
I have a code that creates a table, and names it 'DATA_CONSOL'. And I want to adjust my code so that the most recently created table is always named 'DATA_CONSOL'. This way I can reference it via formulas and not have to worry about it pulling outdated data since the most recent macro run will always produce a table named 'DATA_CONSOL'. The code is written, I just need to add these lines to make it that much better.
This would be a HUGE help!
Thank you!
Bookmarks