E
ExcelMonkey
I have a 5D array. I fill the array with values within 5 imbedded Fo
Next Loops. Assume I use the rnd() function to fill them fo
simplicity. Once I have filled all the rows and columns in the firs
two dimensions (i.e. rows and columns) I want to sum all the data i
column 9. The following is not working. It is giving me a Type Mismatc
Error for ArrayMax.
Private Sub Other()
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim D As Integer
Dim E As Integer
Dim Array1() As Variant
Dim ArrayMax As Variant
ReDim Array1(1 To 9, 1 To 13, 1 To 5, 1 To 5, 1 To 5)
For A = 1 To 5
For B = 1 To 5
For C = 1 To 5
For D = 1 To 13
For E = 1 To 9
Array1(E, D, C, B, A) = Rnd()
Next E
Next D
ArrayMax = Application.Max(Application.Index(Array1, 0, 9, 0, 0, 0))
Next C
Next B
Next A
End Su
Next Loops. Assume I use the rnd() function to fill them fo
simplicity. Once I have filled all the rows and columns in the firs
two dimensions (i.e. rows and columns) I want to sum all the data i
column 9. The following is not working. It is giving me a Type Mismatc
Error for ArrayMax.
Private Sub Other()
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim D As Integer
Dim E As Integer
Dim Array1() As Variant
Dim ArrayMax As Variant
ReDim Array1(1 To 9, 1 To 13, 1 To 5, 1 To 5, 1 To 5)
For A = 1 To 5
For B = 1 To 5
For C = 1 To 5
For D = 1 To 13
For E = 1 To 9
Array1(E, D, C, B, A) = Rnd()
Next E
Next D
ArrayMax = Application.Max(Application.Index(Array1, 0, 9, 0, 0, 0))
Next C
Next B
Next A
End Su