+ Reply to Thread
Results 1 to 9 of 9

Find specific text in column and return cell value from its immediate right

  1. #1
    Registered User
    Join Date
    11-08-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    12

    Find specific text in column and return cell value from its immediate right

    Hi Everyone,

    I am trying to get a cells value to return to a textbox in a userform

    example

    Textbox1 contains "Bob"

    I want it to search worksheet 3 and column A

    If "Bob" is found lets say in A7 then I want it to return the value from B7 to Textbox2

    any Ideas?

    many thanks in advance

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,021

    Re: Find specific text in column and return cell value from its immediate right

    You would typically use VLOOKUP to return a value from a corresponding cell, that is, find a match in column A, return the value from column B.

    So, use Textbox1 as the lookup value and columns A and B as the search range and return column 2 (B) to Textbox2. The last parameter to the VLOOKUP is FALSE.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-08-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Find specific text in column and return cell value from its immediate right

    I am not sure How I would put that into VBA code..

    any suggestions?

    Chris

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Find specific text in column and return cell value from its immediate right

    Hi Chris
    Here's an example
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Find specific text in column and return cell value from its immediate right

    If its all in one column, you could probably just use vlookup.

    Please Login or Register  to view this content.
    Last edited by abousetta; 02-24-2012 at 05:40 PM. Reason: Added not_exact_match parameter, corrected range
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,021

    Re: Find specific text in column and return cell value from its immediate right

    @abousetta: think you might need the fourth parameter: FALSE

    Regards, TMS

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Find specific text in column and return cell value from its immediate right

    Thanks TMS. I usually remember that... I have updated the formula above but don't have time to test it right now (at work).

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Find specific text in column and return cell value from its immediate right

    OK. Got a chance to test it now and made a minor correction to the code in post #5.

  9. #9
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Find specific text in column and return cell value from its immediate right

    Hi,

    If you are satisfied with the responses, then please mark the thread as Solved (instructions in the Forum Rules and FAQs).

    Good luck.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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