Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.
Sub AppendData() Dim wbkMaster As Workbook Dim shtMaster As Worksheet Dim rngMaster As Range Dim wbkData As Workbook Dim shtData As Worksheet Dim rngData As Range ' change path and file name to suit Set wbkMaster = Workbooks.Open("D:\temp\testmaster.xls") Set shtMaster = wbkMaster.Worksheets(1) ' change path and file name to suit Set wbkData = Workbooks.Open("D:\temp\test1.xls") Set shtData = wbkData.Worksheets(1) ' get end of master Set rngMaster = shtMaster.Range("A65536").End(xlUp) ' Change as per your need Set rngData = shtData.Range("A11:A" & shtData.Range("A11").End(xlDown).Row) ' copy data across rngData.Copy rngMaster MsgBox "Appended " & rngData.Rows.Count & " rows of data to Master data", vbInformation ' simply close data wbkData.Close False ' save and close master wbkMaster.Close True ' release objects Set rngData = Nothing Set shtData = Nothing Set wbkData = Nothing Set rngMaster = Nothing Set shtMaster = Nothing Set wbkMaster = Nothing End Sub
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
10 Experts available now in Live!