John,
Here's what you need - it will highlight either the row or the column - not
sure about both yet - This is Chip Pearson's code, modified a little bit, so
i don't really take any credit for it! Just remember to paste it into the
code window of the worksheet you want it to work on - not a normal Visual
Basic module!
Cheers
Pete
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
'-------------------------------------------------------------------------
'Comment out one of these two lines to highlight
'either the selected row or the selected column
With Target.EntireRow
'With Target.EntireColumn
'-------------------------------------------------------------------------
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 10
End With
With .Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 10
End With
End With
.FormatConditions(1).Interior.ColorIndex = 20
End With
End Sub
"John - Vanguard" wrote:
Does anybody know how to have the row and column change colors as you move
the active cell around the worksheet, like crosshairs for a quick visual
reference.
|