I Have the following code which should copy some cell values from another worksheet.
The iZac and iKon are variables refering to first and last row numbers of the targeted range. But I get an application defined error while I am in the target sheet. When I re-write the code with absolute Range names, everything is fine.
But what's wrong with the Range.Cells property? Why isn't it possible to refer with 'cells' to another worksheet?
Thank you for the explanation.
Code:
With Sheets("Zadanie").Range(Cells(iZac, 3), Cells(iKon, 3))
.Copy
Sheets("Objednavka").Range("bZacKopirovania").PasteSpecial xlPasteValues
End With
The iZac and iKon are variables refering to first and last row numbers of the targeted range. But I get an application defined error while I am in the target sheet. When I re-write the code with absolute Range names, everything is fine.
Code:
With Sheets("Zadanie").Range ("C" & iZac & ":C" & iKon)
But what's wrong with the Range.Cells property? Why isn't it possible to refer with 'cells' to another worksheet?
Thank you for the explanation.
Last edited: