Hi, for some reason my command to write to cells("A1:D3") is not working with (toPrint is a Variant)
Worksheets("show").Range(Cells(1.1), Cells(3, 4)).Value = toPrint
so I have now made a loop to force the macro to write out toPrint like
Sub Write2Sheet(toPrint As Variant, position As Variant, sheet As String)
Dim iRow As Integer, iCol As Integer, i As Integer, j As Integer
iRow = position(0)
iCol = position(1)
For i = 1 To UBound(toPrint, 1)
For j = 0 To UBound(toPrint, 2)
Set Worksheets("show").Range(Cells(iRow, iCol), Cells(iRow + i, iCol + j)).Value = toPrint(i, j)
Next j
Next i
Both the tries have generated the same error "Run-time error '1004' - Application-defined or object-defined error". What is that I dont see? it feels so stupid, and I'm sure its something data defined. Please tell me what have been me sleepless during the night.
Worksheets("show").Range(Cells(1.1), Cells(3, 4)).Value = toPrint
so I have now made a loop to force the macro to write out toPrint like
Sub Write2Sheet(toPrint As Variant, position As Variant, sheet As String)
Dim iRow As Integer, iCol As Integer, i As Integer, j As Integer
iRow = position(0)
iCol = position(1)
For i = 1 To UBound(toPrint, 1)
For j = 0 To UBound(toPrint, 2)
Set Worksheets("show").Range(Cells(iRow, iCol), Cells(iRow + i, iCol + j)).Value = toPrint(i, j)
Next j
Next i
Both the tries have generated the same error "Run-time error '1004' - Application-defined or object-defined error". What is that I dont see? it feels so stupid, and I'm sure its something data defined. Please tell me what have been me sleepless during the night.