Public Function MyTest(ByRef TheData As Variant, ByVal RowNum As Long, ByVal ColNum As Long) As Variant
Dim RowLoop As Long, ColLoop As Long
Dim NewCell() As Variant
*** ReDim NewCell(RowNum, ColNum)
For RowLoop = 1 To RowNum
For ColLoop = 1 To ColNum
*** NewCell(RowLoop, ColLoop) = TheData.Cells(RowLoop, ColLoop).Value
Next ColLoop
Next RowLoop
MyTest = NewCell
End Function