Hi
I have had my head spinning with this error. Its the first time I get it and I can't get around it and my deadline is closing in fast. The code is quite straight forward (or what do you say?). I'm trying to make the macro to write out a matrix of number with each element in one cell. The error occurs for a 72x2 matrix. Please help me. I don't want to spend more of my evenings with this error ='(
Function Write2Sheet(toPrint As Variant, position As Variant, sheet As String)
Dim sRow As Integer, sColumn As Integer
sColumn = position(1)
Worksheets(sheet).Range(Cells(sRow, sColumn), _
Cells(sRow + UBound(toPrint, 1), sColumn + UBound(toPrint, 2))).Value = toPrint
End Function
I have had my head spinning with this error. Its the first time I get it and I can't get around it and my deadline is closing in fast. The code is quite straight forward (or what do you say?). I'm trying to make the macro to write out a matrix of number with each element in one cell. The error occurs for a 72x2 matrix. Please help me. I don't want to spend more of my evenings with this error ='(
Function Write2Sheet(toPrint As Variant, position As Variant, sheet As String)
Dim sRow As Integer, sColumn As Integer
sColumn = position(1)
Worksheets(sheet).Range(Cells(sRow, sColumn), _
Cells(sRow + UBound(toPrint, 1), sColumn + UBound(toPrint, 2))).Value = toPrint
End Function