Highlighting the selected row or column

  • Thread starter Thread starter Lewis Clark
  • Start date Start date
L

Lewis Clark

Is there a way to put the cursor in a cell and have that entire row and/or
column highlighted? I would like the highlighting to be temporary and move
with the selected cell.

Thank you in advance.
 
right click sheet tab>view code>insert this>SAVE

'McCurdy.Here is something inspired by Don Guillett.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRng As Range
Set MyRng = Target.EntireRow
Application.EnableEvents = False
On Error GoTo end1
Application.Cells.FormatConditions.Delete
With MyRng
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=ROW()=ROW(INDIRECT(CELL(""address"")))"
With .FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 1
End With
.FormatConditions(1).Interior.ColorIndex = 36
End With
end1:
Application.EnableEvents = True
End Sub
 
Back
Top