how to combine 2 or excel into 1 excel file(different sheet)

  • Thread starter Thread starter althonfx
  • Start date Start date
A

althonfx

hi, i am newbie in excel programming...


can anyone tell me how to combine 2 or excel into 1 excel
file(different sheet)?

example:

i wan combine excel file A and excel file B into excel file C (in
differrent sheet), using marcos.


how should i do??
 
Just a guess, but this will copy sheet1 to sheet3 and copy sheet2 to the
next available row in sheet3:

Sub CopySheets()
Dim iLRow As Long
Sheets("Sheet1").UsedRange.Copy Destination:= _
Sheets("Sheet3").Range("A1")
iLRow = Sheets("Sheet3").Cells(Rows.Count, "A").End(xlUp).Row
Sheets("Sheet2").UsedRange.Copy Destination:= _
Sheets("Sheet3").Range("A" & iLRow + 1)
End Sub

Mike F
 

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