Highlighting Row

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hello All,

Using Windows XP and Excel XP.

I have a code that highlights the entire row of a selected cell:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Cells.Interior.ColorIndex = xlColorIndexNone
ActiveCell.EntireRow.Interior.ColorIndex = 27
End Sub

What I would like to do is to have it just highlight the data in the
selected row to columns A through F, not from A to IV (entire row).

Thanks in advance,
Michael
 
One way:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Cells.Interior.ColorIndex = xlColorIndexNone
Cells(ActiveCell.Row, 1).Resize(1, 6).Interior.ColorIndex = 27
End Sub
 
Perfect! thanks
JE McGimpsey said:
One way:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Cells.Interior.ColorIndex = xlColorIndexNone
Cells(ActiveCell.Row, 1).Resize(1, 6).Interior.ColorIndex = 27
End Sub
 
Back
Top