Combining information from 2 Spreadsheets into 1

  • Thread starter Thread starter japc90
  • Start date Start date
J

japc90

I have a workbook that lists current employees on one spreadsheet and
terminated employees on another. I want to combine all of this
information on one spreadsheet within the same workbook without having
to cut and paste the information to the "All Up" spreadsheet.

Thanks in advance.
 
Try something like this:

Regards,

David Miller

Sub CombineSheets()
Dim NewBk, CurBk, TermBk As Workbook

Set NewBk = ActiveWorkbook
Set CurBk = Workbooks.Open("C:\CurrentEmployees.xls")
Set TermBk = Workbooks.Open("C:\TermEmployees.xls")

CurBk.Sheets(1).UsedRange.Copy
NewBk.Sheets(1).Range("A1").PasteSpecial
TermBk.Sheets(1).UsedRange.Copy
NewBk.Sheets(1).Range("A" & _
NewBk.Sheets(1).Range("A65536").End(xlUp) + 1).PasteSpecial

CurBk.Close
TermBk.Close

Set CurBk = Nothing
Set NewBk = Nothing
Set TermBk = Nothing
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top