Consulting

Results 1 to 3 of 3

Thread: How to prevent Entry more than specified value.

  1. #1

    Unhappy How to prevent Entry more than specified value.

    Hi, i want to know how to lock and unlock (or by validation) a specific cell with specific condition. I attached my file and description is given in that file only. Please do the needful as it is very imp and urgent for me.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Use Data Validatoion woth a formula of

    =OR(AND(B1="Leave",COUNTIF($B$1:$B$10,"Leave")<=3),B1="Present")
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location
    Quote Originally Posted by xld
    Use Data Validation with a formula of

    =OR(AND(B1="Leave",COUNTIF($B$1:$B$10,"Leave")<=3),B1="Present")
    Try the following
    =OR(AND(B2="Leave",COUNTIF($B$2:$B$11,"Leave")<=$C$2),B2="Present")

    I've changed the references from B1 to B2, the CountIf range to $B$2:$B$11, and changed the value 3 to the cell location, so that if the rule changed about how many could be away on leave at any one time, you just need to change the value in cell C2.

    (Sorry Bob)
    Last edited by Aussiebear; 12-26-2007 at 04:46 AM.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •