View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default How to change entire row colour when row is selected?

I like this add-in
http://www.cpearson.com/excel/RowLiner.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl



wrote in message oups.com...
To anyone who can help,

I am trying to change all the text of a row to red and bold when that
row is selected and then change it back to black and unbold when it is
deselected.

I have achieved the first part of my task with the following code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Row = 4 Then
ActiveCell.EntireRow.Font.ColorIndex = 3
ActiveCell.EntireRow.Font.Bold = True
End If
If ActiveCell.Row = 5 Then
ActiveCell.EntireRow.Font.ColorIndex = 3
ActiveCell.EntireRow.Font.Bold = True
End If
End Sub

Can someone please help with the else statement that I would need to
add so that when I change from say, row 4 to 5, the text in row 4 is
returned to black and unbold while the text in row 5 is changed to red
and bold?

Any help will be much appreciated