+ Reply to Thread
Results 1 to 4 of 4

Custom Data Validation - Limit entry to only a whole # that is greater than the cell above

  1. #1
    Registered User
    Join Date
    02-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    28

    Custom Data Validation - Limit entry to only a whole # that is greater than the cell above

    Hello I'm wanting to write a data validation to a cell using VBA (Know how to do this part)

    I need to limit the cell to a positive whole number that must be greater than or equal to the cell immediately above it.

    So A1 would just be data validation for a positive whole number (got this part)
    A2 is the custom one I'm working on/need help with

    Ex. Passes
    A1=3
    A2=5

    Ex. Fails because A2 is not greater than or equal to A1
    A1=3
    A2=1

    Thoughts?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,402

    Re: Custom Data Validation - Limit entry to only a whole # that is greater than the cell a

    You don't need VBA for this. It can be done using normal data validation.

    Data Validation.jpg
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    28

    Re: Custom Data Validation - Limit entry to only a whole # that is greater than the cell a

    The code is what I'm wanting. I'll eventually write it with VBA but if I don't know the code, I can't start anywhere...

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,623

    Re: Custom Data Validation - Limit entry to only a whole # that is greater than the cell a

    One way (up to you to get it into VBA, cos I can't!!):

    =(AND(MOD(A2,1)=0,A2>0,A2>=A1))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

+ 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. Validation Rule to Limit Entry as NAANNAA and Length Between 7 and 10
    By shellp in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-23-2015, 07:41 PM
  2. Replies: 1
    Last Post: 01-24-2014, 09:47 AM
  3. Limit data entry in a series of cells if one cell has data entered.
    By Josiah in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-18-2013, 04:55 PM
  4. custom data validation for alphanumeric entry
    By wotadude in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-19-2009, 04:23 PM
  5. Replies: 7
    Last Post: 05-06-2009, 07:29 PM
  6. custom data validation formula to limit cell value to maximum of 4 decimal places
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2009, 04:42 PM
  7. Custom Data Validation Formula Limit Restriction
    By lovemy65stang in forum Excel General
    Replies: 2
    Last Post: 01-28-2008, 06:39 PM

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