LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default An array of Cells?

Sure

Dim aryCells

Redim aryCells(1 To 5)
Set aryCells(1) = Range("A1:A5")
Set aryCells(2) = Range("H1:H10")
'ETC

MsgBox aryCells(1).address

Redim Preserve aryCells(1 To 15)
set aryCells(12) = range("M1:M10")

MsgBox aryCells(12).address

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

wrote in message
oups.com...
Thanks Bob,

by the way, is there a way I can change the size of that object array?
(i.e. so I create an object called aryCells with indexes 1 thru 5, can
I later modify aryCells to have 15 range objects in it?)
-Abe

Bob Phillips wrote:
Here is an example that should get you started

Dim aryCells(1 To 5) As Object

Set aryCells(1) = Range("A1:A5")
Set aryCells(2) = Range("H1:H10")
'ETC

MsgBox Application.Sum(aryCells(1))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ups.com...

And by cells object, I meant range object.
-Abe




 
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
Need help with cells Array Ayo Excel Discussion (Misc queries) 5 August 7th 08 09:02 PM
combining cells and array from different sheets into an array to pass to IRR() [email protected] Excel Discussion (Misc queries) 3 September 11th 06 07:17 AM
Array vs. Cells Robin Clay[_4_] Excel Programming 6 March 7th 06 11:10 PM
Can a UDF be used on an array of cells? Paul D. Simon Excel Worksheet Functions 3 September 8th 05 06:23 PM
How do I sum an array of cells, even if some of them are #N/A René Excel Discussion (Misc queries) 5 January 18th 05 02:28 PM


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