View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Check if a value is found twice in a range

On Fri, 13 May 2005 01:12:03 -0700, François
wrote:

Hello,
I have to check if a value is found twice in a range and display an error if
Yes.
Lets suppose a range B3:B29 composed of several values not sorted (for ex :
250,412,359,1,6,8,45,18,412).
As 412 is found already in second position (and last one) I would like to
change color of Cell B30 from nothing to Red. Of course could be 18 which
appearing twice or more or any other number...

Thanks for you help and creativity !!!


In Cell B3:

Format/Conditional Formatting/Formula Is: =COUNTIF($B$3:B3,B3)1
Then format to taste.

Then, using the Format Painter, copy that format down as far as is necessary.

(Alternatively, select B3:Bn before typing in the above formula).


--ron