Hi, All,
I want to highlight the current row and column in a table. Searching the knowledge base I found DRJ's Highlight Current Row and Column; I included its code below.
One drawback of this particular implementation is the it clears whatever color formatting one's worksheet already has.
So, question one is how difficult will it be to modify this code to capture the existing color attributes and reset them after the row and/or column changes?
In addition, I prefer that the entire row and column be highlighted, not just that part of the row to the left of the selected cell and above the selected cell.
Are these easily achievable?
[vba]Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim RngRow As Range
Dim RngCol As Range
Dim RngFinal As Range
Dim Row As Long
Dim Col As Long
Cells.Interior.ColorIndex = xlNone
Row = Target.Row
Col = Target.Column
Set RngRow = Range("A" & Row, Target)
Set RngCol = Range(Cells(1, Col), Target)
Set RngFinal = Union(RngRow, RngCol)
RngFinal.Interior.ColorIndex = 6
End Sub[/vba]
Thanks in advance for your advice and guidance.