assigning values to an array

J

Juggernath

Im new to VBA, is there some elegant way to assign number of values to an
array, for ex:

Dim A(0.3265, -1.07, -0.5339, 0.01569, -0.05165, 0.5475, -0.7361, 0.1844,
0.1056, 0.6134, 0.721) As Double
or
Dim A(11) as Double {0.3265, -1.07, -0.5339, 0.01569, -0.05165,
0.5475, -0.7361, 0.1844, 0.1056, 0.6134, 0.721}

instead of
A(1)=0.3265
A(2)=-1.07
....
....
....
....
 
B

Bob Phillips

Dim A
A = [{0.3265, -1.07, -0.5339, 0.01569, -0.05165,0.5475, -0.7361, 0.1844,
0.1056, 0.6134, 0.721}]



--

HTH

RP
(remove nothere from the email address if mailing direct)
 
D

Dave Peterson

One more:

Dim myArr as Variant
dim iCtr as long
myArr = array(0.3265, -1.07, -0.5339, 0.01569, -0.05165, 0.5475, _
-0.7361, 0.1844, 0.1056, 0.6134, 0.721)

for ictr = lbound(myarr) to ubound(myarr)
msgbox myarr(ictr)
next ictr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top