I want a procedure that loads a calling array with the data contained in predefined row and column references of the active spreadsheet. I have gotten this far with the code shown below.
When run, the procedure loads the data but does not pass it back to the calling array. What is missing within the subLoadArray?
Dim aryFunds (6, 3) as Variant
Public Sub UserForm_Initialize()
Range ("A1"
.select
subLoadArray(aryFunds)
End Sub
Private Sub subLoadArray(ByVal ArrayName As Variant) ' load calling array with data
Dim intRow As Integer
Dim intCol As Integer
For intRow = 1 To UBound(ArrayName)
For intCol = 1 To UBound(ArrayName, 2)
strCellContents = ActiveSheet.Cells(intRow, intCol)
ArrayName(intRow, intCol) = strCellContents
Next intCol
Next intRow
End Sub
NOTE: ByRef in the procedure doesn't help either.
Thanks, Numbers
When run, the procedure loads the data but does not pass it back to the calling array. What is missing within the subLoadArray?
Dim aryFunds (6, 3) as Variant
Public Sub UserForm_Initialize()
Range ("A1"
subLoadArray(aryFunds)
End Sub
Private Sub subLoadArray(ByVal ArrayName As Variant) ' load calling array with data
Dim intRow As Integer
Dim intCol As Integer
For intRow = 1 To UBound(ArrayName)
For intCol = 1 To UBound(ArrayName, 2)
strCellContents = ActiveSheet.Cells(intRow, intCol)
ArrayName(intRow, intCol) = strCellContents
Next intCol
Next intRow
End Sub
NOTE: ByRef in the procedure doesn't help either.
Thanks, Numbers