I am trying to combine two excel files into one using the code below. When I execute the code only the FIST cell of the second file gets appended. Can anyone tell me what I am doing wrong?
Thanks, Bob
Sub CombineFiles(x)
Workbooks.Open Filename:="U:\docs\PO IN.xls"
' Count rows in first file
Range("A1"
.Select
With Selection.CurrentRegion
rc = .Rows.Count
rc = rc + 1
End With
Workbooks.Open Filename:="U:\docs\DEP IN.xls"
Range("A1"
.Select
Selection.Copy
ActiveWorkbook.Close
Cells(rc, 1).Select
ActiveSheet.Paste
Thanks, Bob
Sub CombineFiles(x)
Workbooks.Open Filename:="U:\docs\PO IN.xls"
' Count rows in first file
Range("A1"
With Selection.CurrentRegion
rc = .Rows.Count
rc = rc + 1
End With
Workbooks.Open Filename:="U:\docs\DEP IN.xls"
Range("A1"
Selection.Copy
ActiveWorkbook.Close
Cells(rc, 1).Select
ActiveSheet.Paste