B
Benjamin
Is there any way to have excel automatically highlight the row of a selected
cell ?
TIA
Ben
cell ?
TIA
Ben
Bob Phillips said:Ben,
Here is an alternate. It test for rows 2:20, which you can adjust to suit
'----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
If Not Intersect(Target, Range("2:20")) Is Nothing Then
With Target
With .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
.Interior.ColorIndex = 20
End With
End With
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With
End If
End Sub
--
HTH
RP
(remove nothere from the email address if mailing direct)