Run Time Error 1004 - No Cells found

MarkCBB

Active Member
Joined
Apr 12, 2010
Messages
497
Hi there,

I am using some code (Got from VoG). that deletes errors, but Now I have found that sometime the data will not contain errors. Is there an Error handler I can use to bypass the error so that the Code will continue to run> here is the code that I am currently using.

Code:
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Offset(, 18).Select
Selection.FormulaR1C1 = "=IF(ISNUMBER(RC[-8])=TRUE,"""",NA())"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Columns("S").SpecialCells(xlCellTypeConstants, 16).EntireRow.Delete
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi Mark

Replace your last line with:

Code:
Dim rngToDelete As Range
 
On Error Resume Next
Set rngToDelete = Columns("S").SpecialCells(xlCellTypeConstants, 16)
On Error Goto 0
 
If Not rngToDelete is Nothing Then rngToDelete.EntireRow.Delete
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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