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 did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,214,947
Messages
6,122,413
Members
449,082
Latest member
tish101

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
Back
Top