+ Reply to Thread
Results 1 to 6 of 6

More Than One Data validation For the Same Cell

  1. #1
    Registered User
    Join Date
    02-12-2006
    Posts
    54

    More Than One Data validation For the Same Cell

    Hello

    How do I let a certain cell accept confined with two restrictions such as (text length = 7 and this text to be numeric)?

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524
    Please Login or Register  to view this content.
    this goes into your worksheet module, sets A1 as the target

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    You might need to use a macro triggered by the worksheet change event to test for this more complex criteria.
    Martin

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    If you don't need a macro then use this in Tools > Data Validation

    =AND(ISNUMBER(A1),LEN(A1)<=7)

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Registered User
    Join Date
    02-12-2006
    Posts
    54
    Thanks VBA Noob, your way worked the best, and thanks a lot to the rest as well, they were very jelpful as well

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi cgi_pro,

    Thanks for the feedback.

    Glad I could help

    VBA Noob

+ 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