View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default VBA Array Population with a Single Line of Code

Don't get too excited. <g This is extremely limited as to the number of
elements you can load.

--
Regards,
Tom Ogilvy

wrote in message
...
Thanks, Bob.

I'll now be able to quickly load in a multidimensional
array and then shift or paste it as needed via Alan's
toolkit.

- James


-----Original Message-----
Hi James,

Single dimension

Dim a

a = Array(2,3,5,7)

Multi-dimension

Dim beta

beta = [{7,3;8,4;9,5;10,6;11,7;12,8;13,9;14,10}]

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"James B" wrote in

message
...
I'm trying to figure out how to populate an array

variable
in VBA without using something similar to the code

below:

ReDim a(1 To 4)
a(1) = 2
a(2) = 3
a(3) = 5
a(4) = 7

Can this be done with a single line of code? Also, can

I
populate a single section of a multidimensional array

with
something like the following?

beta(7,3 to 14)= ..... the values for those points in

the
array

Any help is certainly appreciated. I've been doing this
the long way for years, and it is driving me crazy!



.