+ Reply to Thread
Results 1 to 7 of 7

VLOOKUP Function to select the cell that has been found

  1. #1
    Forum Contributor
    Join Date
    02-23-2015
    Location
    united kingdom
    MS-Off Ver
    14.0.7143.5000 (32-bit)
    Posts
    124

    VLOOKUP Function to select the cell that has been found

    Hi there,

    I need Lookup to select the cell that has been matched with lookedup value so i am able to assign a new value within such cell.
    so far i got

    /code
    Please Login or Register  to view this content.

    /code
    Last edited by nosense; 08-05-2015 at 01:30 PM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: VLOOKUP Function to select the cell that has been found

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    Since the value of K9 isn't its own named range, it isn't being found.

    Could you use:
    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Contributor
    Join Date
    02-23-2015
    Location
    united kingdom
    MS-Off Ver
    14.0.7143.5000 (32-bit)
    Posts
    124

    Re: VLOOKUP Function to select the cell that has been found

    Quote Originally Posted by daffodil11 View Post
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    Since the value of K9 isn't its own named range, it isn't being found.

    Could you use:
    Please Login or Register  to view this content.
    Many thanks for the reply and comments.

    As you probably notice the line containing "K9" cell is in the code as 'comment so please ignore it.

    What I am trying to achieve is to select the cell that is containing the value found by VLOOKUP function.
    In this case my value is stored as 'result'
    I would like to do something like:

    Please Login or Register  to view this content.
    but it does not work.
    Any ideas?

    PS. I have tried as you suggested

    Please Login or Register  to view this content.
    but promps with 'Syntax Error'
    Last edited by nosense; 08-05-2015 at 01:43 PM.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: VLOOKUP Function to select the cell that has been found

    My code contains a paren after the Cells object.

    Cells(row #, column #) is a range on a worksheet, therefore you could skip the VLOOKUP altogether and utilize the MATCH function to identify the row.

    MATCH(val,A:A,0) = the row you need to return. If you start at D, then 16 is the column 13 to the right of that.


    This will select the cell that contains a match in D for val, in the Column of P.
    Please Login or Register  to view this content.
    You could also use
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-23-2015
    Location
    united kingdom
    MS-Off Ver
    14.0.7143.5000 (32-bit)
    Posts
    124

    Re: VLOOKUP Function to select the cell that has been found

    Quote Originally Posted by daffodil11 View Post
    My code contains a paren after the Cells object.

    Cells(row #, column #) is a range on a worksheet, therefore you could skip the VLOOKUP altogether and utilize the MATCH function to identify the row.

    MATCH(val,A:A,0) = the row you need to return. If you start at D, then 16 is the column 13 to the right of that.


    This will select the cell that contains a match in D for val, in the Column of P.
    Please Login or Register  to view this content.
    You could also use
    Please Login or Register  to view this content.
    i did try it and carried on with my code i.e added a line that assigns value with apparently selected cell as follows:

    Please Login or Register  to view this content.
    but unfortunately it does not paste value where it suppose to (placing it in the currently active cell)

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: VLOOKUP Function to select the cell that has been found

    I've attached two working variations that I imagined. If these don't apply, I'd recommend you posted an example to illustrate your need.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-23-2015
    Location
    united kingdom
    MS-Off Ver
    14.0.7143.5000 (32-bit)
    Posts
    124

    Re: VLOOKUP Function to select the cell that has been found

    Quote Originally Posted by daffodil11 View Post
    I've attached two working variations that I imagined. If these don't apply, I'd recommend you posted an example to illustrate your need.
    The code with 'for' function done it

    many thanks

    Please Login or Register  to view this content.

+ 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. [SOLVED] Vlookup function does not continue when match is not found
    By dresur in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-08-2015, 03:48 PM
  2. Vlookup function error value not found
    By aoora in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-23-2014, 04:43 PM
  3. How to determine range to select once a reference cell is found?
    By ivoryg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-31-2012, 10:29 AM
  4. [SOLVED] How to get the address of the cell found our by vlookup
    By dilettante in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2006, 10:10 PM
  5. Select Range found by Vlookup
    By JG Scott in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2006, 01:10 PM
  6. [SOLVED] Find text String and select cell address where it is found?
    By JCIrish in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-16-2006, 09:45 AM
  7. Replies: 0
    Last Post: 08-25-2005, 03:46 AM

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