+ Reply to Thread
Results 1 to 2 of 2

Couple of vlookup queries

  1. #1
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    171

    Couple of vlookup queries

    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

  2. #2
    Gary L Brown
    Guest

    RE: Couple of vlookup queries

    Try putting...

    Application.Volatile

    right after your Dim statement.

    HTH,
    --
    Gary Brown
    gary_brown@ge_NOSPAM.com
    If this post was helpful, please click the ''Yes'' button next to ''Was this
    Post Helpfull to you?''.


    "T De Villiers" wrote:

    >
    > 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
    >
    >
    > --
    > T De Villiers
    > ------------------------------------------------------------------------
    > T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
    > View this thread: http://www.excelforum.com/showthread...hreadid=505787
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1