+ Reply to Thread
Results 1 to 4 of 4

Doublecheck with second lookup starting starting after first match

Hybrid View

  1. #1
    Registered User
    Join Date
    10-25-2010
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    17

    Doublecheck with second lookup starting starting after first match

    Hi
    Im building a registrationform, that must have a inbuilded check so that no date can have two bookings with the same company. The problem is that im stuck at the second loookup that should start after the first at the cellrange that the first lookup found a datematch.

    please check my workbook and help me solv this!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Doublecheck with second lookup starting starting after first match

    Hi
    I've attached a modified example of your workbook with a possible solution to your problem. You will have to enter both a date and company name to search for double bookings. You will have to modify the formula to work with a bigger range. Remember it is an array formula so enter any changes with Shift+Ctrl+Enter.

    Hope this helps
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-25-2010
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Doublecheck with second lookup starting starting after first match

    Hi

    Thanks for the help!

    So what your saying is that in the vba code:

    Set DateMatch = .Range("A1:A400" & .Cells(Rows.Count, 1).End(xlUp).Row).Find(Datepick.Value, LookIn:=xlValues, lookat:=xlWhole)

    I should search for both at the same time, to get the right match?

    Can you realy use that to check for an array of values?

  4. #4
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Doublecheck with second lookup starting starting after first match

    Hello again
    Sorry, I didn't realize that you wanted to do this with VBA. The workbook I attached only had an array formula on the 'Data' sheet in cell O3. You enter your search values in cells M3 and N3 and the booking message is returned in O3. Having now looked at your code, I think you perhaps know more VBA than I do. I'm not sure how to get array formulas to run in VBA. The only way that I might do it, is to link the form to the Data sheet formula. I think you'll have to search for both date and company to find a match, if I understand your problem correctly. Perhaps another user can help?
    Last edited by DBY; 10-06-2011 at 12:30 PM. Reason: Amended reply

+ 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