Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel cell validation

Status
Not open for further replies.

ron513

Technical User
Mar 9, 2004
31
US

I need assistance with coding cell validation. In a worksheet I want the user to enter a value in one of two cells, a value cannot be in both. Also a message box would be display indicating the error to the user.

Thanks

Ron
 
Have you looked at Excel's built in Data > Validation?

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 

I have, but could not apply it to my situation, although it could be my inexperience.

Ron
 



the occurrence count cannot be greater than ONE. The range is the two cells.

Checkout the COUNTIF function.

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Let's say that the two cells in which someone may enter data are D2 and D4.

Select those cells, go to Data > Validation, On the Settings tab choose Other, type in
[COLOR=blue white]=CountA($D$2, $D$4) < 2[/color]

Configure the message box however you want on the Error Alert tab.



[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
'Glad we could help
[cheers]

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top