Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlight rows in Excel 1

Status
Not open for further replies.

TonyU

Technical User
Feb 14, 2001
1,317
US
hey gurus and experts, how can I modify this code to highlight the entire row ?


Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static OldRange As Range
On Error Resume Next
Target.Interior.ColorIndex = 6
OldRange.Interior.ColorIndex = xlColorIndexNone
Set OldRange = Target

End Sub


Thanks in advance.
[tt]
"The only ideas that will work for you are the ones you put to work."
[/tt]

banana.gif
rockband.gif
banana.gif

 
Hi Tony,

Nice little routine.

Just add the one line that I've added below.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static OldRange As Range
On Error Resume Next
Set Target = ActiveCell.EntireRow
Target.Interior.ColorIndex = 6
OldRange.Interior.ColorIndex = xlColorIndexNone
Set OldRange = Target

End Sub

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Hi Dale, nice 2 c u again, looong time no talk to you. Thanks again Sir
[tt]
"The only ideas that will work for you are the ones you put to work."
[/tt]

banana.gif
rockband.gif
banana.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top