+ Reply to Thread
Results 1 to 3 of 3

VBA Vlookup Nth occurrence help

  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    VBA Vlookup Nth occurrence help

    I have this portion of code

    Please Login or Register  to view this content.
    And this returns the first occurrence of wo. What I want is to be able to do find the 2nd 3rd and 4th occurrences.

    This project has variable number of entries for each Work Order. One work order may have 4 entries (most have one) I will use if statements to determine what is done with the information once found.

    The idea would be something to the effect (logical demonstration only). Can anyone help me with this? I can find plenty of posts online on how to do this on the workbook level.

    Please Login or Register  to view this content.
    Last edited by randell.graybill; 04-04-2013 at 09:12 PM. Reason: fin

  2. #2
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: VBA Vlookup Nth occurrence help

    I took a different approach to this than a vlookup. Probably not the get way to do it but it worked for my needs.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: VBA Vlookup Nth occurrence help

    Hi

    You could do something like this.

    nominate an array which will contain the values required.
    loop through the range (B3:B LR) and if it matches the lookup value, then put the next value across into the array.
    then put the result from the array into the relevant textbox

    Please Login or Register  to view this content.
    The above code is just a bit of a guide for structure and concept.

    HTH

    rylo

+ 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