View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default red Color for same value cells

Hi from the UK,

here is one way

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
If Not Intersect(Target, Range("H1:H:32")) Is Nothing Then
Range("B1:B100").FormatConditions.Delete
For Each cell In Range("H1:H:32")
cell.FormatConditions.Add Type:=xlExpression, _
Formula1:="=" & cell.Address & "=" & Target.Address
cell.FormatConditions(1).Interior.ColorIndex = 3
Next cell
End If

End Sub

it is worksheet event code, so right-click on the sheet tab, select View
Code from the menu, and paste the code in

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Aristotele64" wrote in message
...
Hi from italy,
sorry if question was already posted but i dont'find anithing on goole :
I have a column H1:H:32, example :

h1 Alfa
h2 Beta
h3 Omega
h4 Beta
h5 Omega
h6 Alfa
h7 P
h8 Alfa
h9 P
h10 ecc

when I click on cell taht contain "Alfa" , i want all "alfa" cell become

red
if i click on cell that contain "Beta" , all "Beta" cell become red


TIA








--
-------------------------------------------------------------
se vuoi scrivermi sostituisci tiscali con yahoo
ciao