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: 11,272
Default Highlight non- contiguous rows

Sorry I used oRng not rngSelect.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob Phillips" wrote in message news:...
In mine

Private Sub Commandbutton1_Cl;ick()

Set rngSelect = Nothing
Range("A1").Select

End Sub
Make sure it is in the same worksheet code module

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steve" wrote in message
...
Thanks, guys...

Both work great, but how do I (via a command button) reset the selection
when I need to?
(so no rows are selected...)


--Steve


"Brad" wrote in message
...
Something like this maybe?


Dim rngSelect As Range
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 5 Then Exit Sub ' Make sure it's
column E.
If rngSelect Is Nothing Then ' Create the range if it
doesn't exist.
Set rngSelect = Target.EntireRow
Else ' If it does exist, add
it to the range
Set rngSelect = Union(rngSelect, Target.EntireRow)
End If
rngSelect.Select ' Select the range.
End Sub


Hope that helps.

-Brad


-----Original Message-----
I am trying to create code which will highlight non-
contiguous rows in a
spreadsheet, using a worksheet change event procedure.
Every time the target
column value changes (column "E") I would like select
that row, but without
de-selecting the previous entry.

Example:
change value of cell "E1" to "3", event triggers row 1 to
select.
change value of cell "E4" to "7", event triggers row 4 to
select, but row 1
stays selected also.

Is this possible, or would I have to highlight the rows,
instead of
selecting.


Thanks,

Steve


.







 
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
how to automatically delete non-contiguous rows Hucleberry Hound Excel Discussion (Misc queries) 2 June 28th 12 03:14 PM
Printing non-contiguous rows at the top Rich Burt Excel Worksheet Functions 1 June 16th 09 12:42 AM
AVERAGEing non contiguous rows Mike McLellan Excel Discussion (Misc queries) 2 April 14th 08 09:21 PM
Selecting a group of contiguous rows jfg Excel Discussion (Misc queries) 1 August 7th 07 06:34 AM
Highlight non- contiguous rows Steve[_54_] Excel Programming 5 December 23rd 03 11:10 PM


All times are GMT +1. The time now is 07:29 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"