View Single Post
  #6   Report Post  
mike47338
 
Posts: n/a
Default

Thanks Bob, that is exactly what I was looking for !!

"Bob Phillips" wrote:

Mike,

Just change the line

With Target.Entirerow

to

With Target


--

HTH

RP
(remove nothere from the email address if mailing direct)


"mike47338" wrote in message
...
This works very well except what can I change "With Target.EntireRow" to

so
that only the active cell is highlighted?

"Bob Phillips" wrote:

This is what I use

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
With Target.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
End With
.FormatConditions(1).Interior.ColorIndex = 20
End With

End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"mike47338" wrote in message
...
Is there any way to make a cell change color when you click in it and

then
go
back to it's original color when you go to another cell and each cell

do
the
same thing when it is the current cell?