title: Excel 2010 macro to highlight row of active cell
body: <p>I'm trying to use the following macro, but it's not even recognizing it as macro so I cannot run the macro.  If I change the first like to just "private/public sub test()" it will run, however then it says my Target object isn't defined.</p>
  
  <pre><code>Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  If Target.Cells.Count &gt; 1 Then Exit Sub
  Application.ScreenUpdating = False
  ' Clear the color of all the cells
  Cells.Interior.ColorIndex = 0
  With Target
      ' Highlight the entire row and column that contain the active cell
      .EntireRow.Interior.ColorIndex = 8
      .EntireColumn.Interior.ColorIndex = 8
  End With
  Application.ScreenUpdating = True
  End Sub
  </code></pre>