DonAndress
Active Member
- Joined
- Sep 25, 2011
- Messages
- 362
- Office Version
- 2019
- 2016
- Platform
- Windows
Hello.
I am trying to check if in column there is a formula returning error #N/A.
I use the below line of code.
If #N/A is found, it works perfectly.
But it it's not found (there is no such error in column) I get 'Object variable or With block variable not set' and macro breaks. I don't have any 'With' block in the code.
where destWkb = ThisWorkbook
May I ask for guidance how to fix it?
I am trying to check if in column there is a formula returning error #N/A.
I use the below line of code.
If #N/A is found, it works perfectly.
But it it's not found (there is no such error in column) I get 'Object variable or With block variable not set' and macro breaks. I don't have any 'With' block in the code.
VBA Code:
searchNA = destWkb.Sheets("temp").Range("H:H").Find("#N/A", LookIn:=xlValues, searchdirection:=xlPrevious, searchorder:=xlByRows).row
May I ask for guidance how to fix it?