Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Selecting multiple ranges using 'Cells' notation

Thanks Bob
I'll give it a try
Peter

"Bob Phillips" wrote in message
...
Hi Peter,

One way

With ActiveSheet
Union(.Range(.Cells(8, 5), .Cells(8, 11)), .Range(.Cells(8, 21),
.Cells(8, 27))).Select
End With


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pete" wrote in message
...
Hi to all in the group
Is it possible to 'set' the range of a variable (defined as Range) to a
multi-range using Cells notation?

This works:
Set RngWeek = Range("E8:K8,U8:AA8")

The macro will I set a row to be the active row
Say it is row 8
Can I set the range using the a command similar to the one below
This doesn't work:
Set RngWeek = Range(Cells(ActiveCell.Row, 5), Cells(ActiveCell.Row, 11),
Cells(ActiveCell.Row, 21), Cells(ActiveCell.Row, 27))

Peter Bircher
Kwazulu-Natal, SA






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
Trouble with selecting multiple ranges of data markag Excel Worksheet Functions 2 June 23rd 06 04:35 PM
Refer to Ranges using Cells notation Scott P Excel Programming 3 June 30th 05 06:08 AM
Selecting ranges of cells Dale Fye Excel Programming 5 March 10th 05 12:50 AM
selecting multiple ranges Helen Excel Programming 3 January 16th 05 03:46 AM
Selecting two ranges of unadjacent cells CTInt04 Excel Programming 3 July 7th 04 07:48 PM


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