close

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 (quot;Desktop\My Documents\Book10!Sheet1!a1:b3quot;) valid?

Many ThanksFunction taz(a) As Variant
Dim res As Variant
res = Application.VLookup(a, Range(quot;Sheet1!a1:b3quot;), 2, 0)

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

If IsError(res) Then
taz = quot;Not foundquot;
Else
taz = res
End If

End Function--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: www.excelforum.com/member.php...oamp;userid=26479
View this thread: www.excelforum.com/showthread...hreadid=505787Try putting...

Application.Volatile

right after your Dim statement.

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.quot;T De Villiersquot; wrote:

gt;
gt; Hi,
gt; Two things:
gt;
gt; 1) The following doesn't re-calculate as I change the inputs,
gt; I have to F2 and press enter each time
gt; 2) Also if there is an error it doesnt pick up the new lookup,
gt; is (quot;Desktop\My Documents\Book10!Sheet1!a1:b3quot;) valid?
gt;
gt; Many Thanks
gt;
gt;
gt; Function taz(a) As Variant
gt; Dim res As Variant
gt; res = Application.VLookup(a, Range(quot;Sheet1!a1:b3quot;), 2, 0)
gt;
gt; If IsError(res) Then
gt; res = Application.VLookup(a, Range(quot;Desktop\My
gt; Documents\Book10!Sheet1!a1:b3quot;), 2, 0)
gt; End If
gt;
gt; If IsError(res) Then
gt; taz = quot;Not foundquot;
gt; Else
gt; taz = res
gt; End If
gt;
gt; End Function
gt;
gt;
gt; --
gt; T De Villiers
gt; ------------------------------------------------------------------------
gt; T De Villiers's Profile: www.excelforum.com/member.php...oamp;userid=26479
gt; View this thread: www.excelforum.com/showthread...hreadid=505787
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()