(no subject)

J

John

I want to save multiple possibilities for a range and be able to pop one
back into the range. Is there a way to do this other than saving the
ranges to an array? Can't use copy, paste because there are more than one.

Have Myrange = (Cells(1,1),cells(70,70))

then have 6 different versions of myrange.

thanks
John
 
B

Bob Bridges

Well, depending on the objection you have to an array, maybe a collection
would work better for you. In fact, now that a more experienced programmer
has explained collections to me, I think they're better for this purpose:
You don't have to have any idea ahead of time how many you'll need to store,
and you can label them by a string or a sequential index, whichever works
better for you. (In fact, you can use both at once.) You can create the
Range object and Add it to your collection...though I think you can store
objects in arrays, too, so that isn't really an advantage of collections over
arrays.

But then, you're still storing the ranges one by one and pulling them back
one by one, and in that sense a collection isn't that different from an
array. What do you already know about collections, and if you know about
them, how are you hoping to improve on both them and arrays?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top