Allow only 12 entries in a column

G

Gary

I have a sheet with Products on them. I only the customer to choose up to
12 items. They do this by putting a quantity in column "D".

I would like a message box to appear if they have filled in more than 12
rows for column "D". So on the 13th entry, the message box should appear.
How can I do this?

Thanks,

Gary
 
T

Tom Ogilvy

Use Data validation

Select column D

data=>Validation

Select custom from the Allow: dropdown

put in the custom formula:

=CountA(D:D)<=13

then go to the message tab and enter your message

Change 13 to 12 if you don't have a header entry in D1.
 
G

Gary

Tom,

Thanks for the reply but I just tried it and it works well for the column.
What if I wanted to only count entries in rows 2-50? Only allow 12 entries
in those rows? I tried to modify the =CountA(D:D)<=13 to
=CountA(D2:D50)<=13, but it didn't work.

Thanks,

Gary
 
T

Tom Ogilvy

You need to use absolute cell references

=CountA($D$2:$D$50)<13

Select D2:D50 and do Data=>Validation, entering that formula
 
Top