Question : Determine if validated data has already been used

Hello, this question builds upon a previous question here by me, and an example of what I want to do is attached as a file.  I am working on a territory limits tracking issue and I am thinking this may require some VB code.  I have cut/pasted VB code for Excel Macros before, but not sure how to find something to do what I need below.

We have 3 people that are responsible for certain lengths of roads/streets.  The Columns "Beginning Mile" and "Ending Mile" are validated with a data range from 5 to 120.  The user gets an error message if they try to enter data oustide those limits.

What I would like to do is if someone wants to edit their beginning or ending mile data (and passes the the data validation I put on those cells) is warn the user they are now encroaching on someone else's territory.  Of course, that may be intentional, but our current method of tracking does not give any kind of warning when this happens.

For example in the attached excel file, Me's territory on I-35 is from Mile 5 to Mile 60.  You's (or Youse, depending on your accent) territory is from Mile 60.01 to Mile 120.  Them is a new hire, and his manager gives them a territory from Mile 10 to Mile 20.  This would be a conflict, as Miles 10 - 20 are already covered.

How do I get Excel to see that issue and warn the user about it?

If there is a better way to do this, I am open to suggestions.

Thank you!

 
 
 

Answer : Determine if validated data has already been used

Use Conditional Formatting.  In Excel 2007/2010:

1) Select the cells in Col A you to apply this to

2) On the Home tab of the Ribbon, click Conditional FOrmatting | Manage RUles

3) Add a new rule, with rule type 'formula to determine format

4) Use a formula of

=COUNTIF(B:B,A2)>0    <assuming A2 is the first cell to be formatted>

and click Format to choose your formatting options
Random Solutions  
 
programming4us programming4us