ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Allow only 12 entries in a column (https://www.excelbanter.com/excel-programming/295455-allow-only-12-entries-column.html)

Gary[_16_]

Allow only 12 entries in a column
 
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



Tom Ogilvy

Allow only 12 entries in a column
 
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.

--
Regards,
Tom Ogilvy

"Gary" wrote in message
...
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





Gary[_16_]

Allow only 12 entries in a column
 
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

"Tom Ogilvy" wrote in message
...
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.

--
Regards,
Tom Ogilvy

"Gary" wrote in message
...
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







Tom Ogilvy

Allow only 12 entries in a column
 
You need to use absolute cell references

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

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

--
Regards,
Tom Ogilvy

"Gary" wrote in message
...
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

"Tom Ogilvy" wrote in message
...
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.

--
Regards,
Tom Ogilvy

"Gary" wrote in message
...
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










All times are GMT +1. The time now is 03:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com