Highlight rows
I think this will do what you want:
Right-click the worksheet tab, and paste this code in the window that opens...
'----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
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
With .EntireColumn
..FormatConditions.Delete
..FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlLeft)
..LineStyle = xlContinuous
..Weight = xlThin
..ColorIndex = 5
End With
With .Borders(xlRight)
..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 Sub
I forgot where I got this, but I think it was from this discussion group a
while back.
Regards,
Ryan---
--
RyGuy
"Scott R" wrote:
Hi Guys,Im pretty sure this cant be done but thought id check with the
brainstrust..
I have XL2003 and would like the entire row to be highlighted when im in a
particular cell so it is easy to reference data in other cells on that row. I
know i could click on the row number itself but is there a way for it to
happen by just being in a particular cell?
|