# basic array question

#### axg275

##### Active Member
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

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
Can you post an HTML of your worksheet so we can see what you're trying to accomplish with this code?

Thanks,
Mac

Replies
2
Views
66
Replies
1
Views
30
Replies
8
Views
262
Replies
8
Views
105
Replies
7
Views
98