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
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Macropheliac

Board Regular
Joined
Aug 26, 2005
Messages
165
Can you post an HTML of your worksheet so we can see what you're trying to accomplish with this code?

Thanks,
Mac
 

Watch MrExcel Video

Forum statistics

Threads
1,114,403
Messages
5,547,750
Members
410,811
Latest member
adustin42
Top