Replacing Data in Named Tables

exelified

New Member
Joined
Mar 8, 2021
Messages
9
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
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?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,136,206
Messages
5,674,410
Members
419,507
Latest member
karenvanegas

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top