Milan Cetic
New Member
- Joined
- Oct 9, 2020
- Messages
- 8
- Office Version
- 2019
- Platform
- Windows
I'm trying to copy cells from one workbook to another (copyfrom.xslm and copyto.xlsx)
This is the code I'm using
Sub CopyToWorkbook()
Range("A1:D4").Copy Workbooks("copyto").Worksheets("Sheet1").Range("A5")
End Sub
When I execute the code I get the Runtime error '9': Subscript out of range.
It's like there is no copyto file although it is open. Makes no sense but this is what's happening. Any ideas?
Thanks!
This is the code I'm using
Sub CopyToWorkbook()
Range("A1:D4").Copy Workbooks("copyto").Worksheets("Sheet1").Range("A5")
End Sub
When I execute the code I get the Runtime error '9': Subscript out of range.
It's like there is no copyto file although it is open. Makes no sense but this is what's happening. Any ideas?
Thanks!