# VBForums CodeBank > CodeBank - Other >  [VBA] Highlight Selected Row

## dday9

Here is a VBA snippet that I use to help me keep track of what row I'm on. I use Excel 2007 so I'm not sure if this would work on any other versions(although it should):

This one highlights just the row:


```
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    'Remove any interior color
    Cells.Interior.ColorIndex = 0
    'Remove any cell borders
    Cells.Borders.LineStyle = xlNone
    'Set the interior color of the active row as some color
    Target.EntireRow.Interior.ColorIndex = 37 '37 is a pastel blue color
    'Set the border of the active cell
    Target.Cells.Borders.LineStyle = xlContinuous
End Sub
```

This one highlights the row and the column:


```
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    'Remove any interior color
    Cells.Interior.ColorIndex = 0
    'Remove any cell borders
    Cells.Borders.LineStyle = xlNone
    'Set the interior color of the active row and column as some color
    Union(Target.EntireRow, Target.EntireColumn).Interior.ColorIndex = 37 '37 is a pastel blue color
    'Set the border of the active cell
    Target.Cells.Borders.LineStyle = xlContinuous
End Sub
```

I use this a lot because I do a bunch of cold calls at work and having the row be a separate color than the other rows really helps me keep track of where I'm at.

----------

