+ Reply to Thread
Results 1 to 8 of 8

Get Vlookup Result Address

  1. #1
    Registered User
    Join Date
    08-11-2021
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    24

    Get Vlookup Result Address

    Hi,

    I am trying to get the address of the following result.
    I have this formula:

    TextBox6.Text = Application.WorksheetFunction.VLookup(Range("M2"), Range("A2:K16"), Application.WorksheetFunction.Match(TextBox5.Text, Range("A1:K1"), 0), 0)

    How can i get the cell address of the result from the above formula?

    Thank you in advance

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Get Vlookup Result Address

    Use two match functions instead of Vlookup and Match. That way you will have the row position and column position, so you can use Range("A2:K16").cells(rowpos, colpos).Address
    Rory

  3. #3
    Registered User
    Join Date
    08-11-2021
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    24

    Re: Get Vlookup Result Address

    Hi Rorya

    Thank you for the reply.

    I getting errors when I tried to replace vlookup with a match. the error is "Wrong number of arguments or invalid property assignment"

    Could you please help to edit the code and reply with the correct code?

    Thank you so much.

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Get Vlookup Result Address

    Something like this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-11-2021
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    24

    Re: Get Vlookup Result Address

    Hi.

    That works. Thank you once again.

    sorry I have another 2 questions.

    1. matchrow = Application.Match(TextBox1.Text, Range("A2:A16"), 0) why do I get an error when I change the range("M2") to textbox1.Text?
    2. how can I include multiple criteria? in the matchrow? i tried the following
    matchrow = Application.Match(Range("M2"), Range("A2:A16"), 0) + Application.Match(Range("M3"), Range("B2:B16"), 0)
    but I am getting the wrong address.
    Last edited by thoufik11; 08-12-2021 at 10:35 PM.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Get Vlookup Result Address

    1. What's the error?
    2. Match doesn't work like that. You'd be better off with a loop if you need to match values in two columns (and that would be a separate question, IMO)

  7. #7
    Registered User
    Join Date
    08-11-2021
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    24

    Re: Get Vlookup Result Address

    the error is "Method 'Range' of object '_Global' failed"

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Get Vlookup Result Address

    Try specifying the sheet for the range.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Jump to cell address of Vlookup result
    By propaniacs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-20-2021, 01:06 PM
  2. [SOLVED] Ask.Formula result as any address
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-22-2018, 01:53 AM
  3. [SOLVED] Replacing cell address in a formula with the result of ADDRESS function
    By CMG2 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-25-2014, 02:59 AM
  4. Cell Address from result of Min
    By scottylad2 in forum Excel General
    Replies: 5
    Last Post: 04-27-2011, 03:48 PM
  5. How do I user result of ADDRESS
    By LEberhart in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-05-2007, 03:36 PM
  6. [SOLVED] How can I use the result from ADDRESS in another formula
    By Bill in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-27-2006, 10:45 PM
  7. [SOLVED] Using Address Result
    By Yossi in forum Excel General
    Replies: 2
    Last Post: 04-16-2005, 05:06 AM

Tags for this Thread

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