Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Array of Range Objects

Is it possible to create an array of range objects? I have used the Set stmt
for range objects (Example #1). Is it possible to set up many rang objects
in an array and use the Set stmt on this array(Example #2)? If so how would
you dimension the array?

Example #1
Set rng = ........

Example#2
For X = 0 to 10
Set RngArray(0) = .....
Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Array of Range Objects

You could set up your array to hold variants which will allow for ranges but
a collection is generally a little easier when you want to store a group of
objects. Something like this...

Sub test()
Dim colRanges As Collection
Dim rng

Set colRanges = New Collection
With colRanges
.Add Range("A1:A10")
.Add Range("B1:B10")
.Add Range("C1:C10")
End With

For Each rng In colRanges
MsgBox rng.Address
Next rng
End Sub
--
HTH...

Jim Thomlinson


"ExcelMonkey" wrote:

Is it possible to create an array of range objects? I have used the Set stmt
for range objects (Example #1). Is it possible to set up many rang objects
in an array and use the Set stmt on this array(Example #2)? If so how would
you dimension the array?

Example #1
Set rng = ........

Example#2
For X = 0 to 10
Set RngArray(0) = .....
Next

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
Form Objects in an array? NateBuckley Excel Programming 3 May 10th 08 12:52 PM
Set array of objects to nothing Matthew Pfluger Excel Programming 2 January 21st 08 02:29 PM
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) Keith R[_2_] Excel Programming 3 November 13th 07 04:08 PM
How to get individual range objects from a set of range objects? Dev Excel Programming 4 February 4th 07 12:14 AM
Test for end of array of objects? peter Excel Programming 8 February 3rd 05 09:15 AM


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