View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Highlight non- contiguous rows

Steve,

How about this?

Dim oRng As Range

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Column = 5 Then
If oRng Is Nothing Then
Set oRng = Target.EntireRow
Else
Set oRng = Union(oRng, Target.EntireRow)
End If
oRng.Select
End If
End Sub


--

HTH

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

"Steve" wrote in 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