tomsov
New Member
- Joined
- Mar 31, 2017
- Messages
- 24
Hello, this is driving me crazy as I've checked numerous times that my file location and name is correct. This bit of code keeps throwing the error 'Runtime Error 9, subscript out of range' and I can't fathom the reason why - I've checked and double checked that the file names, location, extension is exactly right as to what and where it is on my PC but continue to get the error. The error is always on the the Set wsDest = part of the code. Help much appreciated!
Dim wsCopy As Worksheet
Dim wsDest As Worksheet
Dim lCopyLastRow As Long
Dim lDestLastRow As Long
Set wsCopy = ThisWorkbook.Worksheets("Sage Output")
Set wsDest = Workbooks("C:\Users\minee\Desktop\InvoiceRecordSheet.xlsx").Worksheets("SageBook")
... [code to copy etc]
Dim wsCopy As Worksheet
Dim wsDest As Worksheet
Dim lCopyLastRow As Long
Dim lDestLastRow As Long
Set wsCopy = ThisWorkbook.Worksheets("Sage Output")
Set wsDest = Workbooks("C:\Users\minee\Desktop\InvoiceRecordSheet.xlsx").Worksheets("SageBook")
... [code to copy etc]