Thanks. I'm working with an employees and their associated departments table "EMPL" which will expand or contract month to month so the table's data needs to be refreshed at different intervals. The worksheet has several different tables.
I have VLOOKUP functions in other worksheets that are dependent on the table name Ex: =VLOOKUP(B5,EMPL,3,0) to yield Manager's name. Because I'm fairly new at VBA and don't know what the hell I'm doing, I'm currently running a macro which 1) deletes the existing/host worksheet (to get rid of the table), 2) loads a replacement worksheet with new data and 3) creates a new table with a same name. This potentially incorrect methodology not only breaks the connections of the VLOOKUP formulas but I end up with #REF remnants of "EMPL" in Named Ranges which appear to be confusing the formulas.
So my question is one of best practices and approaches I suppose: Is there a way to "swap" all/old data in a named table for all new data - thereby maintaining the table name's integrity so my VLOOKUP formulas won't break or should I be looking into deleting table names before creating new ones along with the worksheets I'm deleting in the macro?
I have VLOOKUP functions in other worksheets that are dependent on the table name Ex: =VLOOKUP(B5,EMPL,3,0) to yield Manager's name. Because I'm fairly new at VBA and don't know what the hell I'm doing, I'm currently running a macro which 1) deletes the existing/host worksheet (to get rid of the table), 2) loads a replacement worksheet with new data and 3) creates a new table with a same name. This potentially incorrect methodology not only breaks the connections of the VLOOKUP formulas but I end up with #REF remnants of "EMPL" in Named Ranges which appear to be confusing the formulas.
So my question is one of best practices and approaches I suppose: Is there a way to "swap" all/old data in a named table for all new data - thereby maintaining the table name's integrity so my VLOOKUP formulas won't break or should I be looking into deleting table names before creating new ones along with the worksheets I'm deleting in the macro?