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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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