View Single Post
  #7   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

I tested on B1:B100 and changed just before I posted it. Missed that one.

--

HTH

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

"Aristotele64" wrote in message
...
Many tkanks !!!!
It's working beatiful !!!!
I change only :

Range("B1:B100").FormatConditions.Delete

in
Range("H2:H32").FormatConditions.Delete


right ?

by and good evining !!



"Bob Phillips" ha scritto nel

messaggio
...
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

--