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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top