LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
Jzz Jzz is offline
external usenet poster
 
Posts: 20
Default Highlighting entire row

Hi all
I've tried the code and it works more beautifull when you write it like
this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static OldRange As Range
On Error Resume Next
OldRange.EntireRow.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Interior.ColorIndex = 6 ' yellow - change as needed
Set OldRange = Target

End Sub

First change the oldrange to None and than change the newrange to
yellow.
Otherwise there is a problem when the new range contains the old range
(for example old range = B4 and new range = B2:B6). Then the old range
is set to blank after the new range is yellow.

Grtz,

Jzz

 
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
Highlighting Entire Row without the Mouse F. Lawrence Kulchar Excel Discussion (Misc queries) 11 February 6th 09 09:45 AM
Highlighting Entire Row using CF davisk Excel Worksheet Functions 3 November 14th 07 07:05 AM
highlighting entire functions BorisS Excel Discussion (Misc queries) 2 June 22nd 06 02:28 AM
Highlighting an entire row using conditional formatting. SystemHack Excel Worksheet Functions 5 January 27th 06 01:24 AM
Highlighting entire row cursor on John Excel Discussion (Misc queries) 1 January 22nd 06 08:40 PM


All times are GMT +1. The time now is 09:26 AM.

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"