Delete Row from Table

ManUBlueJay

Active Member
Joined
Aug 30, 2012
Messages
302
Office Version
  1. 2016
Platform
  1. Windows
I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell.
In the past I have used this simple code "Range("MyRange").EntireRow.Delete"

This does not work today in Excel 2016
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Is that cell within your table?
 
Upvote 0
No, but I am calling it while I am on a different sheet. However I tried selecting the sheet with the table (Would prefer not to) and then running the macro. I get the same error
 
Upvote 0
The fact that you have a different sheet active, should not make any difference.
The only way I can get the same error as you, is if the sheet is protected, so not sure why you are having trouble.
 
Upvote 0
It is for sure ot protected. To be safe I added a line Worksheets("database").Unprotect, still get the same Run time 1004
 
Upvote 0
What are you using in tour named range. I am using Offset and Match to find the cell I am looking to delete. Everything looks good till I run the Macro
 
Upvote 0
=OFFSET(Database!$X$1,MATCH(DeleteName,All_UpdateTable_Names,0),0)
DeleteName a also named Range
All_UpdateTable_Names is another named range that is the whole column in the table where the names are stored.

It finds the exact cell I am looking for.

One clue is this was a file that was first created in 2002 and has been through a bunch of Excel updates and maybe I am looking at something Corrupted deep down.
It is currently Excel 2016
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,519
Members
448,968
Latest member
Ajax40

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