+ Reply to Thread
Results 1 to 3 of 3

Check Userform controls for identical values

  1. #1
    Registered User
    Join Date
    06-11-2009
    Location
    Berlin
    MS-Off Ver
    Excel 2003
    Posts
    63

    Check Userform controls for identical values

    Hi all,
    I have a userform with 6 separate date pickers. I need to check if any of the dates the user selects are equal to one another so I can generate an error message. The only way I know how to do this is pretty dumb - using 15 IF Structures...

    Also it would be nice to know if they are all in ascending order.
    Can anyone help me with a more elegant solution?

    Thanks a lot!
    Nick

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Check Userform controls for identical values

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Check Userform controls for identical values

    I can easily do it with conditional formatting in a worksheet, as in this workbook Date Conditional Formatting.xls
    Look at the conditional formatting in the cells, and adapt it to your textbox_change events in your userform.
    Or if you attach a workbook with a sample form as royUK suggests, someone can apply it for you.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

+ 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