vba to delete rows in table error

dshafique

Board Regular
Joined
Jun 19, 2017
Messages
171
Hi guys, for one of my spreadsheets i wanted the vba to check if a cell was blank in the first column of my table, and if so to delete it.

this is the code which i usually use
Code:
Range("IRA[CIO]")..SpecialCells(xlBlanks).EntireRow.Delete

but when i run it, i get an error saying delete method of range class failed.

any idea what it is and how i can overcome this?

thanks
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I see two ..
I think it should only be one.
Range("IRA[CIO]")..SpecialCells(xlBlanks).EntireRow.Delete
 
Upvote 0
Please tell us what your trying to do.
Is IRA a sheet name?

Give specifics.
 
Upvote 0
Have you confirmed column IRA[CIO] is completely empty in your table? That error suggests it may not be, hence it can't find any special cells to then delete entire row...
 
Upvote 0
IRA is the name of a table in one of my sheets. there are gaps in the CIO column, which I wanted it to delete. I found a workaround for it,
i just did
Code:
Columns("A").[COLOR=#333333]SpecialCells(xlBlanks).EntireRow.Delete[/COLOR]
it did what I needed it to. thanks :)
 
Upvote 0
Does seem unusual your workaround works but the original didn't, the only part you've changed is the range object ...

.. but happy days, glad it's resolved and you found your own answer!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,328
Messages
6,124,299
Members
449,149
Latest member
mwdbActuary

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