+ Reply to Thread
Results 1 to 10 of 10

VLOOKUP in VBA to find search with multiple occurences

  1. #1
    Registered User
    Join Date
    09-23-2015
    Location
    Kamloops, BC
    MS-Off Ver
    2010
    Posts
    6

    VLOOKUP in VBA to find search with multiple occurences

    So I'm attempting to write a macro to loop through an array of data and return all instances of the criteria. Using the following code, I am getting 1999 entries of the same date.

    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    Is there any way find all occurrences of Employee_Name in the Lookup_Range?

    Any advice would be greatly appreciated!
    Last edited by 6StringJazzer; 11-24-2015 at 02:11 PM.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VLOOKUP in VBA to find search with multiple occurences

    What do you want to do with said "found occurences"?
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: VLOOKUP in VBA to find search with multiple occurences

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-23-2015
    Location
    Kamloops, BC
    MS-Off Ver
    2010
    Posts
    6

    Re: VLOOKUP in VBA to find search with multiple occurences

    I want to list how many times an employee got hurt. So loop through all the data, which is first aid data on current employees, find any time "Fred" was hurt, then list the date in column H of Template (2)

  5. #5
    Registered User
    Join Date
    09-23-2015
    Location
    Kamloops, BC
    MS-Off Ver
    2010
    Posts
    6

    Re: VLOOKUP in VBA to find search with multiple occurences

    Please Login or Register  to view this content.

    The whole for loop inserted?
    Last edited by iswizzle; 11-24-2015 at 03:03 PM.

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VLOOKUP in VBA to find search with multiple occurences

    What is the relationship between the persons name and the date in range C1 to L2000 is the date above, below, to the right, etc? Is the name in only one column? Can the dates in column H of the Template (2) be stacked together or do they need to be representative of the initial row source?

  7. #7
    Registered User
    Join Date
    09-23-2015
    Location
    Kamloops, BC
    MS-Off Ver
    2010
    Posts
    6

    Re: VLOOKUP in VBA to find search with multiple occurences

    Quote Originally Posted by stnkynts View Post
    What is the relationship between the persons name and the date in range C1 to L2000 is the date above, below, to the right, etc? Is the name in only one column? Can the dates in column H of the Template (2) be stacked together or do they need to be representative of the initial row source?
    Name is in column C and date is in column D. And I'm not quite sure what you mean.. Excel noob here :P

  8. #8
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VLOOKUP in VBA to find search with multiple occurences

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-23-2015
    Location
    Kamloops, BC
    MS-Off Ver
    2010
    Posts
    6

    Re: VLOOKUP in VBA to find search with multiple occurences

    Quote Originally Posted by stnkynts View Post
    Please Login or Register  to view this content.
    worked perfectly. thankyou!!

  10. #10
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,866

    Re: VLOOKUP in VBA to find search with multiple occurences

    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

    If a member helped you solve your problem, consider adding to their reputation by clicking on the star icon below their name.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. VLOOKUP to find multiple occurences
    By valhallaone in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 12-20-2013, 02:55 PM
  2. Find Multiple Occurences from Multiple Sources
    By erome in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-24-2012, 01:16 PM
  3. Search Multiple Occurences of String
    By greasybob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2012, 02:58 PM
  4. Vlookup to find all occurences (based on dropdown value)
    By D_N_L in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-17-2012, 08:21 AM
  5. Can't use vlookup to count multiple occurences in same collumn?
    By The Hylander in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2009, 06:15 AM
  6. Replies: 2
    Last Post: 07-27-2009, 10:48 PM
  7. VLOOKUP Multiple Occurences of Same Reference?
    By anagaraj in forum Excel General
    Replies: 2
    Last Post: 01-06-2009, 12:59 PM
  8. Vlookup date from multiple occurences
    By markmac234 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-26-2008, 10:31 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