View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Problem with "#N/A" after vlookup

Dim sFormula as string

sFormula = "VLOOKUP(A4," & myLookUpRng.Address(1, 1, xlA1,True) &
",19,0)"
sformula = "=IF(ISNA(" & sformula & "),""""," & sformula & ")"
With Cells(4, "I").Resize(numRows)
.Formula = sformula
.Value = .Value
End With



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Les Stout" wrote in message
...
Hi all, i am doing a series of Vlookups and if the value is not found i
get "#N/A" which i would like to replace with the text "Not found".
Any help or suggestion would be appreciated

With Cells(4, "I").Resize(numRows)
.Formula = "=VLOOKUP(A4," & myLookUpRng.Address(1, 1, xlA1,
True) & ",19,0)"
.Value = .Value
End With
Thanks in advance

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***