If / True

  • Thread starter Thread starter Dan Van
  • Start date Start date
D

Dan Van

I posted this yesterday, but I don't see it coming across in my Outlook
Express. Not sure why.
************************************************************************

I have the following statement and
I need to perform a function if a match is found, if no match, leave the
cell alone

RS = Application.Lookup(Range("81!F" & Z), Range("LOOKUP81!$A$1:$A$3"),
Range("LOOKUP81!$B$1:$B$3"))

if RS is true **************** Need the syntax
range("81!F" & z).value = RS
else
range("81!F" & z).value = range("81!F" & z)
end if

Thanks in advance
 
Dan,

If the LOOKUP function failed to find a match, it will return a
#NA error value to RS, so you can use IsError to test RS. For
example,

If IsError(RS) = False Then
' lookup found a match
Else
' lookup failed
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top