Deleting and recreating a table without breaking references

Luke777

Board Regular
Joined
Aug 10, 2020
Messages
246
Office Version
  1. 365
Platform
  1. Windows
Hi,

My problem stems from bad practice, that much I know, but I'm wondering if there's a simple solution to it or not.

Essentially, I have an archive sheet that contains my starting data set.

I then copy the used range of this archive to my Data sheet, then go through each record, deleting it based on some variables (purging bad data). The remaining records are then converted to a table with the name TasksData.

The archive is updated daily, the macro responsible for this also calls the sub that handles the Data sheet. For simplicity, I have been using Data.Cells.ClearContents to completely remove everything from the sheet, and rebuild it from scratch.

When I initially built this, I just wanted to get something working quickly (the code to delete is much simpler than adding to a table). Obviously it has several flaws, but the main one is that formula references to TasksData break. Is there a simple solution to this (turning off recalculation on the sheet with formulas in question?) or will I have to "do it properly" and stop deleting the table, but add to it instead?

Thanks
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
You'll have to do it properly. ;) (there are alternatives but they are not good ones)
 
Upvote 1

Forum statistics

Threads
1,223,886
Messages
6,175,193
Members
452,616
Latest member
intern444

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