Problem Deleting Cells

Can_This_Be_Don

Board Regular
Joined
Feb 15, 2005
Messages
88
Have set up a user form that allows me to add records to a spreadsheet. Sometimes the new record button is hit and no data is actually input. Even so this creates a record on the spreadsheet.

If I use the filter button this shows the blank row and I can delete the record. As I need to automate the procedure I've tried using various suggestions I've found on the forum but they do not seem to work.

The last piece I found suggested using this code:

Columns("I:I").SpecialCells(xlCellTypeBlanks).EntireRow.Delete

This does not seem to delete the blank records as an error comes up saying "No cells were found" even though they appear using the filter.

Can anyone please help. :x

Don
 

Some videos you may like

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Nimrod

MrExcel MVP
Joined
Apr 29, 2002
Messages
6,259
what Colmn are the blanks located in ?? What Column are you using to filter by ... is the entire row blank ? If the entire row is blank why are you attempting to delete it ?
 

Watch MrExcel Video

Forum statistics

Threads
1,123,318
Messages
5,600,925
Members
414,416
Latest member
Nobu

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