two dimensional array

yosegmail

New Member
Joined
Dec 15, 2017
Messages
40
vba procedure that use For/Next loops
to store the contents in range A1:E5 to a two dimensional Array? and three dimensional Array?
 
Last edited:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
For a two dimesional array:

Code:
Arrayname=Range("A1:E5")
 
Upvote 0
yes but i may not be able to call say when i want it to
Arraynames(2)???

i came this far

Const I = 5
Const J = 5
Dim myArray(I, J) As Integer

For Each t In Range("a1:e5")

Stop
Next


say after myArray(1,2) should give the values
in the range specifed
 
Last edited:
Upvote 0
I am not at all clear what you are trying to do.
the code i posted loads all the values in the range A1 to A5 into the array Arraynames,
you can loop through with code like :
Code:
For i = 1 to 5
 msgbox(arrayname(i,1)
next i

you can refer to the value in A2 with code such as:
Code:
a2value=Arrayname(2,1)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top