Morning everyone,
I need some urgent help with a macro I am trying to use. Basically, I want information to go from A3:I3 on “payment information” to a new workbook entitled invoices paid. I have got the following macro which seems to work between worksheets fine, but when I try to do it between workbooks I get a run-time error “9”: message saying that the “subscript is out of range”.
This is the macro:
Sub CopyHistData()
Dim SrcSheet As String
Dim DestSheet As String
SrcSheet = "[Purchase Ledger Template.xlsx]Payment Information" 'Change to suit
DestSheet = "[Invoices Paid.xlsx]Payments Made" 'Change to suit
Sheets(SrcSheet).Range("A3:I3").Copy
Sheets(DestSheet).Range("A2" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValuesAndNumberFormats
Application.CutCopyMode = False
End Sub
If anyone is able to offer any advice on what I’m doing wrong it would be very gratefully received.
Thank you!
Bookmarks