When you feed the INDEX funciton a 0, you're telling it "I want the entire row or column".
If you assign Application.Index(wsrgcmes, 0, 1)
to a variant, it works fine...you've got a variant with an array in it.
If you try to print Application.Index(wsrgcmes, 0, 1)
to the immediate window, you get an error because you're trying to print an array. You need to wrap it in a JOIN function.
I don't know why you are getting an error on Application.Index(wsrgcmes, 14630, 1)
but my guess is that at the time you did it, wsrgcmes wasn't populated or wasn't that dimension. I'd need to see a screenshot of both the exact part of the code you were using when the error occurred as well as a screenshot of the array in the Watch Window.
I don't believe your issue is caused by the limitations of INDEX, because you are nowhere near them.
The below code shows the limitations of INDEX when called from VBA:
Sub IndexLimitations()
Dim v As Variant
Dim i As Long
Dim j As Long
Dim k As Long
Dim vArray As Variant
Dim vItem As Variant
vArray = Array(65536, 65537, 1048576, 1048577)
For Each vItem In vArray
i = vItem
ReDim v(1 To i, 1 To 2)
For j = 1 To i
For k = 1 To 2
v(j, k) = j * k
Next k
Next j
Debug.Print "Rows dimension test: " & i
Debug.Print Application.Index(v, i, 1)
Debug.Print ""
ReDim v(1 To 2, 1 To i)
For j = 1 To i
For k = 1 To 2
v(k, j) = j * k
Next k
Next j
Debug.Print "Columns dimension test: " & i
Debug.Print Application.Index(v, 1, i)
Debug.Print ""
Next vItem
End Sub
Here's what it returns:
Rows dimension test: 65536
65536
Columns dimension test: 65536
65536
Rows dimension test: 65537
65537
Columns dimension test: 65537
Error 2023
Rows dimension test: 1048576
1048576
Columns dimension test: 1048576
Error 2023
Rows dimension test: 1048577
1048577
Columns dimension test: 1048577
Error 2023
The learning here is that you are limited to 65536 columns if using the INDEX function to return a column, but you don't seem to be limited to the number of rows in the grid. I suspect this is related to the TRANSPOSE bug I mention in passing at http://dailydoseofexcel.com/archives/2013/10/23/dictionaries-can-be-rude/