Good Morning,
I would like some help with the following code (which I have adapted from another post) this copies cells from specified sheet and pastes to next available line in another workbook. it works perfectly when I try to paste values but I need it to paste a link.
any help gratefully appreciated.
Many Thanks Mick
I would like some help with the following code (which I have adapted from another post) this copies cells from specified sheet and pastes to next available line in another workbook. it works perfectly when I try to paste values but I need it to paste a link.
any help gratefully appreciated.
Many Thanks Mick
Code:
Sub CopynPasteWrkBk()
Dim InputFile As Workbook
Dim OutputFile As Workbook
Dim Inputpath As String
Dim Outputpath As String '
'## Open both workbooks first:
Set InputFile = ActiveWorkbook
Set OutputFile = Workbooks.Open("C:\Users\MICK\Dropbox\Sandymount Construction\Estimates 2016\Estimate List.xlsx")
'Now, copy what you want from InputFile:
InputFile.Sheets("Imput Sheet").Activate
InputFile.Sheets("Imput Sheet").Range("B24:G24").Copy
'Now, paste to OutputFile worksheet:
OutputFile.Sheets("Estimates").Activate
OutputFile.Sheets("Estimates").Range("A" & Rows.Count).End(xlUp).Offset(1).Paste Link:=True
'Close InputFile & OutputFile:
OutputFile.Close savechanges:=True
Application.CutCopyMode = False
MsgBox "Data Successfully Logged"
End Sub