E
ExcelMonkey
I have a 2D array which I set up as a 2 columns and X Rows. I transpose it
to be X Rows by 2 Columns. I then test the max of the array and get an odd
result. The code is quite extensive but here is the just.
I set a break point and I print the transposed array contents to the
Immediate window in the first loop I get the following using the code below:
For X = 0 To UBound(NumberSetArray, 1)
Debug.Print NumberSetArray(X, 0) & ","; NumberSetArray(X, 1)
Next
I get the following in the Immediate Window:
7, 49
Immediately after printing tot the Immediate Window, I test for a max value
in the Immediate window using:
?Application.WorksheetFunction.Max(Application.Index(NumberSetArray, , 1))
I get a value of 0.
Shouldn't the result be 7?
Whe I do the same test on the second column of the array I get:
?Application.WorksheetFunction.Max(Application.Index(NumberSetArray, , 2))
52
Which I know to be correct.
Have I set the Index up incorrectly when attempting to apply the min
function to the first column
Thanks
EM
to be X Rows by 2 Columns. I then test the max of the array and get an odd
result. The code is quite extensive but here is the just.
I set a break point and I print the transposed array contents to the
Immediate window in the first loop I get the following using the code below:
For X = 0 To UBound(NumberSetArray, 1)
Debug.Print NumberSetArray(X, 0) & ","; NumberSetArray(X, 1)
Next
I get the following in the Immediate Window:
7, 49
Immediately after printing tot the Immediate Window, I test for a max value
in the Immediate window using:
?Application.WorksheetFunction.Max(Application.Index(NumberSetArray, , 1))
I get a value of 0.
Shouldn't the result be 7?
Whe I do the same test on the second column of the array I get:
?Application.WorksheetFunction.Max(Application.Index(NumberSetArray, , 2))
52
Which I know to be correct.
Have I set the Index up incorrectly when attempting to apply the min
function to the first column
Thanks
EM