Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy way to get values into an array

Status
Not open for further replies.

InfiniteLives

Programmer
Dec 29, 1999
2
GB
I have set a multivalue array. I know the figures I want in each element. I have tried to set them. e.g.<br>
<br>
array=(1,56,3,23,8,98) and so on.<br>
<br>
Yes you can call me dense. I knew as soon as the error message came up why this is wrong.<br>
<br>
Please tell me there is an easier way to set the values other than<br>
<br>
array(0,0)=1<br>
array(0,1)=56 etc.<br>
<br>
Thanks
 
in a Do Loop<br>
Or for next if you have a definte number of reps<br>
here's a simple example<br>
------------------------------<br>
Private Sub Form_Load()<br>
Dim array1(20, 30)<br>
For a = 1 To 10<br>
For b = 1 To 30<br>
Somenumber = Somenumber + 3<br>
Othernumber = Othernumber + 2<br>
array1(b, a) = Somenumber<br>
Next b<br>
Next a<br>
End Sub<br>
------------------------------<br>
you can increment Somenumber and Othernumber any way you like<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top