Ignore error

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Ignore error

Post by VegasNath »

Hi,

Set RngFound = y6a.Find(What:=RngFind, LookIn:=xlValues, LookAt:=xlWhole)

How can I ignore the error if RngFind is not found in RngFound?
:wales: Nathan :uk:
There's no place like home.....

User avatar
HansV
Administrator
Posts: 79030
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Ignore error

Post by HansV »

If the search value isn't found, RngFound will be set to Nothing. So you can continue with

Code: Select all

If RngFound Is Nothing Then
  ' Value was not found
  ...
Else
  ' Value was found
  ...
End If
Best wishes,
Hans

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Ignore error

Post by VegasNath »

Thanks.
:wales: Nathan :uk:
There's no place like home.....