Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Declare Multidimensional Arrays

You might want to consider:

Dim MultidimensionalArray(1 To 3)
MultidimensionalArray(1) = Array("a", "b", "c")
MultidimensionalArray(2) = Array("d", "e", "f")
MultidimensionalArray(3) = Array("g", "h", "i")
For i = 1 To 3: For j = 0 To 2
Debug.Print MultidimensionalArray(i)(j)
Next: Next

Alan Beban

Brent McIntyre wrote:
Good evening all,

I received some help recently regarding Multidimensional
Arrays, and now I require some more, any help you may be
able to give would be much appreciated.

I am setting out a Multidimensional Array, ie.

a b c
d e f
g h i

To do this in VBA I would type

MultidimensionalArray(1,0) = "a"
MultidimensionalArray(1,1) = "b"
MultidimensionalArray(1,2) = "c"

MultidimensionalArray(2,0) = "d"
MultidimensionalArray(2,1) = "e"
MultidimensionalArray(2,2) = "f"

MultidimensionalArray(3,0) = "g"
MultidimensionalArray(3,1) = "h"
MultidimensionalArray(3,2) = "i"

I am wanting to know if there is a quicker way to do this
with less code, ie.

MultidimensionArray(1,"a","b","c")
MultidimensionArray(2,"d","e","f")
MultidimensionArray(3,"g","h","i")

This code does not work, but I am sure there must be
similar code in VBA somewhere to do this.

Any help you may be able to provide would be much
appreciated.

Yours sincerely,

Brent McIntyre



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
How can I write multidimensional arrays in Excel Formulas? Vasil Ivanov Excel Worksheet Functions 2 September 13th 06 10:58 AM
using linest excel function from msaccess with multidimensional ar jobxyz Excel Worksheet Functions 1 December 26th 05 02:11 PM
Declare Multidimensional Arrays Alan Beban[_3_] Excel Programming 3 August 21st 03 02:40 AM
Multidimensional Arrays - VBA Brent McIntyre Excel Programming 3 August 11th 03 09:01 AM
Multidimensional Arrays - VBA Brent McIntyre Excel Programming 14 August 8th 03 10:49 PM


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