Merging two workbooks

  • Thread starter Thread starter Fred Smith
  • Start date Start date
F

Fred Smith

I'm trying to merge two workbooks.

I select the next available row in my Bookname workbook by:

Range("A2").End(xlDown).Offset(1, 0).Select

Then I open the other workbook, determine the range and say:

Sheets("Sheet1").Range("A1").CurrentRegion.Copy _
Destination:=BookName.ActiveSheet.ActiveCell

But VBA doesn't like my destination. How do I specify the currently selected
cell in my destination workbook? Or, alternatively, the first free row (the
one after xldown)?
 
with the source workbook active:

Sheets("Sheet1").Range("A1").CurrentRegion.Copy
BookName.Range("A2").End(xlDown).Offset(1, 0).PasteSpecial xlPasteAll
 
I tried that, but when I close the source workbook, I get the message
"There's a large amount of data in the clipboard."

Do I just turn off displayalerts, or is there a better way?
 
Hi Fred
just disabling the alerts before the workbook close statement (and
enabling it afterwards again) is IMHO the easiest way
 
Back
Top