Run-time error'1004': No cells were found

kier0978

New Member
Joined
May 31, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi all

I have got error message 'Run-time error'1004': No cells were found' every time I run the macro. I have highlighted the portion in red where I cannot pass it.

Is there anyone can help me with it?


Sub ESTIMATING_SHEET_REFRESH_CC()

ActiveSheet.Range("$DI$1:$DI$1370").AutoFilter Field:=1

Range("ESIF").Copy
Range("DW3:HR3").PasteSpecial
Range("ESIF1").Copy
Range("DW3:HR3").SpecialCells _
(xlCellTypeFormulas, xlNumbers).Select

Selection.PasteSpecial (xlPasteFormulas)

Selection.Copy
Selection.PasteSpecial (xlPasteValues)

Application.CutCopyMode = False


Range("ESIF5").Copy
Range("G23:DB23").PasteSpecial (xlPasteFormulas)
Range("ESIF7").Copy

Range("G23:DB23").SpecialCells _
(xlCellTypeFormulas, xlNumbers).Select

Selection.PasteSpecial (xlPasteFormulas)

Range("G23:DB23").ClearContents



ActiveSheet.Range("$DI$1:$DI$1370").AutoFilter Field:=1, Criteria1:=Array( _
"0", "1", "="), Operator:=xlFilterValues



Application.CutCopyMode = False
Range("B15").Select

End Sub
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi

Ttry
VBA Code:
Range("DW3:HR3").SpecialCells(xlCellTypeFormulas, 1).Select
 
Upvote 0
The most likely issue is that you don't have anything in the range "DW3:HR3", that meets the criteria.

Try is manually.
Select "DW3:HR3" and hit <F5> (goto) , click "Special" then select "Formula" clear all the boxes except "Numbers".
Does it come back with "No cells were found" ?

The criteria are:
- the cell must contain a formula
- the result of the formula in the cell must be a number.

1654067587566.png
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,618
Members
449,092
Latest member
amyap

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