basic array question

axg275

Active Member
Joined
Oct 5, 2004
Messages
308
what might be wrong with this code can some one tell me by looking really quick?

Sub multidimarray()

Dim i As Integer ' stoiip 1
Dim j As Integer ' RF 2
Dim k As Integer ' Initial well rate 3
Dim l As Integer ' Well Drainage Area 4
Dim m As Integer ' Cost for producer 5
Dim n As Integer ' URF cost 6
Dim o As Integer ' tieback distance 7

'i = 0
'j = 0
'k = 0
'l = 0
'm = 0
'n = 0
'o = 0
stoiip = 5 ' mmstb/km2
RF = 0.1 ' percent
IWR = 1 ' mstb/d
WDA = 1 'km/producder
CFP = 30 'mm
URF = 2 'mm
TBD = 1 ' km

Dim MY(1 To 10, 1 To 7, 1 To 10, 1 To 10, 1 To 10, 1 To 10, 1 To 10) As Single '7 dimensional array

For i = 1 To 10

MY(i, j, k, l, m, n, o) = stoiip
stoiip = stoiip + 10

For j = 1 To 7
MY(i, j, k, l, m, n, o) = RF
RF = RF + 0.1

For k = 1 To 10
IWR = IWR + 10
MY(i, j, k, l, m, n, o) = IWR

For l = 1 To 10
WDA = WDA + 1
MY(i, j, k, l, m, n, o) = WDA

For m = 1 To 10
CFP = CFP + 5
MY(i, j, k, l, m, n, o) = CFP

For n = 1 To 10
URF = URF + 2
MY(i, j, k, l, m, n, o) = URF

For o = 1 To 10
MY(i, j, k, l, m, n, o) = TBD
TBD = TBD + 1

Next o
Next n
Next m
Next l
Next k
Next j
Next i





End Sub

Thanks
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Can you post an HTML of your worksheet so we can see what you're trying to accomplish with this code?

Thanks,
Mac
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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