Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Storing multiple ranges using a macro

I have to play with lot of ranges in a worksheet. Say range1 is from
A1:A10, range2 is from B1:B10 and so on. I have 1000s of such
ranges.

One of doing it is defining individial ranges say

dim range1 as range
dim range2 as range
.....
....
....

etc.

I dont want to use 1000 variables for 1000 different ranges. Is there
any way of creating an array of ranges? OR Whats the best way of
doing it?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default Storing multiple ranges using a macro

Hi

Sure, you can use an array:

Sub Test()
Dim RangeArray(1000) As Range

For c = 0 To 999
Set RangeArray(c) = Range("A1:A10").Offset(0, c)
Next
End Sub

Regards,
Per
"Chaman" skrev i meddelelsen
...
I have to play with lot of ranges in a worksheet. Say range1 is from
A1:A10, range2 is from B1:B10 and so on. I have 1000s of such
ranges.

One of doing it is defining individial ranges say

dim range1 as range
dim range2 as range
....
...
...

etc.

I dont want to use 1000 variables for 1000 different ranges. Is there
any way of creating an array of ranges? OR Whats the best way of
doing it?


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
Storing Macro Results daphoenix Excel Worksheet Functions 1 June 26th 08 05:48 PM
Multiple IF statements looking up multiple ranges. mike Excel Worksheet Functions 7 August 9th 07 04:55 PM
Can I create Multiple passwords to edit multiple ranges? Conker10382 Excel Discussion (Misc queries) 8 December 31st 06 07:58 PM
Macro Help (Uppercase multiple ranges?) Ken Excel Discussion (Misc queries) 14 December 2nd 06 07:23 PM
How do i update multiple data ranges across multiple worksheets? mwah Excel Discussion (Misc queries) 0 July 6th 06 04:57 AM


All times are GMT +1. The time now is 11:08 AM.

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"