+ Reply to Thread
Results 1 to 3 of 3

Retrieve data based on 2 choices

  1. #1
    Registered User
    Join Date
    09-18-2010
    Location
    Oklahoma, US
    MS-Off Ver
    Excel 2013
    Posts
    2

    Retrieve data based on 2 choices

    I need to find a way to make Vlookup in VBA use 2 requirements.

    My formula:
    Please Login or Register  to view this content.
    Please disregard the message box part as that is just a placeholder for something else later but it helps me determine if my code is working. This is code that I have built off of.

    I have a separate sheet with data from A - AG. My code allows me to find a name I gave my values such as "ABC123" and loads the data on another sheet filling in the details. Why? It is recalling an old file we sent and adding it so I can see what was sent and I can resend it with new data.

    My confusion so far has been needing to provide an option for the B column (B1) with the Version. Example: I send a form with name ABC123 and Version: 00. If I have to send a correction, I have to add 01 but the name stays the same. So basically, I will have the same PON name multiple times but VLOOKUP only finds the first one.

    What I am needing is to find a way to search by PON and by Version If it could do a search and provide all the versions ahead of time, that would be great but I don't know if that is a reach for VBA. Otherwise, worst case, how can I make multiple conditions with prompts to be met for VLOOKUP in this code?
    Last edited by FDibbins; 03-10-2017 at 01:02 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Retrieve data based on 2 choices

    snapshot, welcome to the forum

    A few observations...
    1. 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.

    Click on Edit to open your thread, then 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

    (I will add them for you - this time )[/B]

    2. Do you really need VBA for this? You could probably do it just as easily with a formula
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-18-2010
    Location
    Oklahoma, US
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Retrieve data based on 2 choices

    Ah thanks. I seriously but not heavily looked for how to do it. Now I know. I technically signed up in 2010 but finally decided to ask a post. There's a lot of useful information in the threads and I never had to ask in here because I could always find my answers.

    The way I have it laid out here, I could see why you would suggest to use a formula. However, I have a userform I have created that I plan to incorporate this code into. Before I could do that, I'm working through the basics. I'm just taking baby steps.

    So in case it doesn't make sense up there, once the user inputs the data and presses a button, it carries it over to another sheet "Sheet2". On sheet 2, it has the raw data by rows. So every answer from the 20 or so questions is inputted into a new cell on a row. Then if you press the button again, it knows to go to the next row and put the information in. I was happy when I figured this out. That part works. However, if a user wants to recall a unique name of "ABC123" that a user gave a form, the formula finds it appropriately. But because I have versions that anytime a supplement is made, the user adds 00, 01, 02, etc. VLOOKUP only stops at the first value that it finds which could be an older version.

    What my mission is to find a way to search by "PON" and by "Version". I'm not really sure if there is a separate code to search for all Versions based on PON name. Something that showed all values with wildcards in front and back. So, "ABC123" would return any PONs that had "ABC123A" and "ABC1234". But I would be completely happy with just a code that if specified could find the exact PON and Version as requested.

+ 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] Retrieve the heading based on data
    By kumawat_s in forum Excel General
    Replies: 9
    Last Post: 03-25-2015, 03:43 PM
  2. [SOLVED] Retrieve Data From Cell Based in Array Based on LARGE Function
    By justarandomguy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-13-2014, 02:31 AM
  3. [SOLVED] Auto data entry based on dropdown choices
    By dkatorza in forum Excel General
    Replies: 3
    Last Post: 08-03-2014, 10:20 AM
  4. Replies: 3
    Last Post: 10-28-2013, 03:33 PM
  5. Pulling data based on two data validation choices
    By jennjennbrokaw in forum Excel Formulas & Functions
    Replies: 41
    Last Post: 02-11-2013, 02:06 AM
  6. Replies: 2
    Last Post: 02-27-2009, 02:01 PM
  7. [SOLVED] Schedule help: formula based on 3 choices of data?
    By TNT in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2006, 10:15 PM

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