Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default How to initialize a multi-dimensional array

I have tried to search the web, but have now found a good way to initialize
a two (or more) dimensional array. Its easy in most other languages. Is
there a good way to do it in excel vab?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default How to initialize a multi-dimensional array

For i = 1 to N

On Mar 5, 3:18*pm, wrote:
I have tried to search the web, but have now found a good way to initialize
a two (or more) dimensional array. *Its easy in most other languages. *Is
there a good way to do it in excel vab?

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default How to initialize a multi-dimensional array

Sorry - glitch there!
For i = 1 to N
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default How to initialize a multi-dimensional array

What the..!
For i = 1 to N
For j = 1 to M
MyArray(i, j) = whatever
Next j
Next i

Sounds like you know this already and want something else, but thought
I'd send it just in case.
regards
Paul

On Mar 5, 3:41*pm, Paul Robinson wrote:
Sorry - glitch there!
For i = 1 to N


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default How to initialize a multi-dimensional array

You can initialize or reinitialize a multi-dimensional array with the Redim
instruction :
ReDim MyArray(1 To 3, 2 To 5, 1 To 2)

Mishell

a écrit dans le message de news:
...
I have tried to search the web, but have now found a good way to initialize
a two (or more) dimensional array. Its easy in most other languages. Is
there a good way to do it in excel vab?

Thanks!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default How to initialize a multi-dimensional array

Erase myArray

--

HTH

Bob

wrote in message
...
I have tried to search the web, but have now found a good way to initialize
a two (or more) dimensional array. Its easy in most other languages. Is
there a good way to do it in excel vab?

Thanks!



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default How to initialize a multi-dimensional array

You can't initialize an array (with the exception of a single variant
containing an array) to values other than the standard defaults
without looping through each dimension or assigning each element by
itself. So, the answer is really that you can't do it.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com



On Fri, 05 Mar 2010 10:18:39 -0500, wrote:

I have tried to search the web, but have now found a good way to initialize
a two (or more) dimensional array. Its easy in most other languages. Is
there a good way to do it in excel vab?

Thanks!

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default How to initialize a multi-dimensional array

On 3/5/2010 11:34 AM, Chip Pearson wrote:
You can't initialize an array (with the exception of a single variant
containing an array) to values other than the standard defaults
without looping through each dimension or assigning each element by
itself. So, the answer is really that you can't do it.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com



On Fri, 05 Mar 2010 10:18:39 -0500, wrote:

I have tried to search the web, but have now found a good way to initialize
a two (or more) dimensional array. Its easy in most other languages. Is
there a good way to do it in excel vab?

Thanks!


Here's what I think is an interesting way to have a 10 * 10 array of the
value 5 without looping. I don't believe 'Sign can be threaded once.

Sub Demo()
Dim M
M = [5*TRANSPOSE(SIGN(ROW(A1:J10))*SIGN(COLUMN(A1:J10)) )]
End Sub

= = = = = = =
HTH :)
Dana DeLouis
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default How to initialize a multi-dimensional array

That's what I was afraid of. My question was not as clear as I thought it
was, sorry. You clearly understood that I was as asking for a way to
initialize the values of an array at compile rather than execute time.
Though, I suppose there isn't so much difference with an intreperted
language.

Thanks you your reply.

On Fri, 05 Mar 2010 10:34:26 -0600, Chip Pearson wrote:

You can't initialize an array (with the exception of a single variant
containing an array) to values other than the standard defaults
without looping through each dimension or assigning each element by
itself. So, the answer is really that you can't do it.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com



On Fri, 05 Mar 2010 10:18:39 -0500, wrote:

I have tried to search the web, but have now found a good way to initialize
a two (or more) dimensional array. Its easy in most other languages. Is
there a good way to do it in excel vab?

Thanks!


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
Multi-Dimensional Array Procedures [email protected] Excel Programming 2 March 6th 08 05:32 PM
Multi Dimensional Array steve Excel Programming 4 September 26th 06 07:33 PM
Multi Dimensional Array andym Excel Programming 11 July 10th 06 05:09 AM
Multi-Dimensional Array Let & Get Trip[_3_] Excel Programming 0 September 21st 05 08:41 PM
Enumerating a multi-dimensional array Robert Stober Excel Programming 7 September 13th 03 12:28 PM


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