Couple of vlookup queries

T

T De Villiers

Hi,
Two things:

1) The following doesn't re-calculate as I change the inputs,
I have to F2 and press enter each time
2) Also if there is an error it doesnt pick up the new lookup,
is ("Desktop\My Documents\Book10!Sheet1!a1:b3") valid?

Many Thanks


Function taz(a) As Variant
Dim res As Variant
res = Application.VLookup(a, Range("Sheet1!a1:b3"), 2, 0)

If IsError(res) Then
res = Application.VLookup(a, Range("Desktop\My
Documents\Book10!Sheet1!a1:b3"), 2, 0)
End If

If IsError(res) Then
taz = "Not found"
Else
taz = res
End If

End Function
 

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

v function 1
vlookup 3
Iserror and vlookup 1
select case simplification request 7
Shortening a vlookup 9
Converting to absolute reference 1
Make VBA ComboBox_Change work in 3 sheets 1
Type Mismatch Error 5

Top