Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default multiple selection problem

How can i code muliple selections say i want to select rows 3,5,7
together

like

Rows(3).select
Rows(5).select
Rows(7).select



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default multiple selection problem

One way

Sub test()
Range("a3,a5,a7").EntireRow.Select
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"XLNT" wrote in message ...
How can i code muliple selections say i want to select rows 3,5,7
together

like

Rows(3).select
Rows(5).select
Rows(7).select



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default multiple selection problem

Use Union

for i = 3 to 7 step 2
if rng is nothing then
set rng = Rows(i)
else
set rng = Union(rng,rows(i))
Next

or

set rng = Range("A3,A5,A7").EntireRow

demo from the immediate window:
set rng = Range("A3,A5,A7").EntireRow
? rng.Address
$3:$3,$5:$5,$7:$7

so also
set rng = Range("3:3,5:5,7:7")

demo from the immediate window:
set rng = Range("3:3,5:5,7:7")
? rng.Address
$3:$3,$5:$5,$7:$7



--
Regards,
Tom Ogilvy

"XLNT" wrote in message
...
How can i code muliple selections say i want to select rows 3,5,7
together

like

Rows(3).select
Rows(5).select
Rows(7).select



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



Reply
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
Selection problem Just wondering Excel Discussion (Misc queries) 2 November 6th 09 01:54 AM
Excell Row Selection Problem cmvonweber Excel Discussion (Misc queries) 2 November 23rd 08 03:41 PM
Cell selection problem DanG Excel Discussion (Misc queries) 2 March 17th 06 05:15 PM
Selection mode problem Richard L. Trethewey New Users to Excel 2 November 23rd 05 07:45 PM
Cannot Group that selection Problem PFL Excel Discussion (Misc queries) 5 January 5th 05 02:07 AM


All times are GMT +1. The time now is 08:49 PM.

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

About Us

"It's about Microsoft Excel"