LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to change entire row colour when row is selected?

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change selected cell shading colour Chas Excel Discussion (Misc queries) 2 July 7th 09 06:54 PM
how do I change the colour of selected auto filter tabs stan zawadzki Excel Worksheet Functions 2 June 5th 07 05:52 PM
selected cells doesnot change colour Zarrar Janjua New Users to Excel 9 May 22nd 07 02:45 PM
change highlight colour of selected cells Starskys Bird Excel Discussion (Misc queries) 1 April 29th 06 02:27 PM
how to colour the entire row with the selected word murtuza kahn Excel Discussion (Misc queries) 1 March 15th 06 09:37 PM


All times are GMT +1. The time now is 04:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"