I was able to use the Macro below to copy data from a closed workbook into my open workbook just fine. However, the final row in the open workbook will change as the Macro is run daily and the open workbook grows, so looking for help to change where the data pastes in the open workbook to the next row down from the last filled row. The data is pasting into "MasterData" in the active workbook. An added bonus would be if I can get the range where the data is coming from "UpdateData" to encompass columns A:I regardless of how many rows down it goes.
Sub Import_Template()
Dim wb As Workbook
Dim rng As Range
Dim lastRow As Long
Application.ScreenUpdating = False
Set wb = Workbooks.Open("L:\New Accounts\Andrew\Projects\Master File Template.xlsx", True, True)
Set rng = wb.Worksheets("UpdateData").Range("A2:I200")
With ThisWorkbook.Worksheets("MasterData")
rng.Copy
.Range("A8").PasteSpecial Paste:=xlValues
End With
wb.Close False
Set wb = Nothing
Application.ScreenUpdating = True
End Sub
Thanks!
Sub Import_Template()
Dim wb As Workbook
Dim rng As Range
Dim lastRow As Long
Application.ScreenUpdating = False
Set wb = Workbooks.Open("L:\New Accounts\Andrew\Projects\Master File Template.xlsx", True, True)
Set rng = wb.Worksheets("UpdateData").Range("A2:I200")
With ThisWorkbook.Worksheets("MasterData")
rng.Copy
.Range("A8").PasteSpecial Paste:=xlValues
End With
wb.Close False
Set wb = Nothing
Application.ScreenUpdating = True
End Sub
Thanks!