ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Links and Linking in Excel (https://www.excelbanter.com/links-linking-excel/)
-   -   Appending external worksheets into existing workbook? (https://www.excelbanter.com/links-linking-excel/47187-appending-external-worksheets-into-existing-workbook.html)

Xuratoth

Appending external worksheets into existing workbook?
 
Hi,

I was wondering - I need to iterate through a set of identically formatted workbooks (values will be different in key cells of course).

For each workbook, I need to extract 2 worksheets that I will place into my consolidation workbook. The workbook code will extract the data required based on a worksheet that I have created (so the worksheets that are imported must have the same tab names to ensure that my formulae work). results are stored in a final worksheet - 1 row per import. On the next import, the two worksheets will be deleted and replaced by a fresh new set. Hope this makes sense.

The problem is, I have no idea how to perofrm the open/copy-append part of the code. I am an Access developer by trade, so VB is not the issue. It's the Excel way of working that I am having to learn the hard way! :)

If anyone can help me, I would ve very grateful indeed!

Many thanks.

Bill Manville

Not sure I follow the scenario.
How about recording your actions when doing it manually, using the
macro recorder.
If there are then issues you need to address you can post the code and
ask about the specific issues.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup


Xuratoth

Quote:

Originally Posted by Bill Manville
Not sure I follow the scenario.
How about recording your actions when doing it manually, using the
macro recorder.

That's just it, I can't even figure out how to do it using menus!

To simplify the problem and strip out all the "story" around it, here it is in a nutshell:

Is it possible to have a workbook open, and IMPORT another workbook's sheets into it?

I just knew that I was making no sense! ;)

Xuratoth

Actually, I reckon that I can do it another way:

Open the other workbook. Select the required sheets. Copy them to the master workbook. I've just recorded that macro and it seems to work ok.

The problem was that I was trying to suck them in directly, trying to have something along the lines of Insert-Worksheet From Existing Workbook.

Bill Manville

You need to open both workbooks, activate the workbook to copy from,
select the sheet(s) to copy and Edit / Move or Copy Sheet / Create a
Copy / and nominate the workbook to copy to

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup


Xuratoth

Quote:

Originally Posted by Bill Manville
You need to open both workbooks, activate the workbook to copy from,
select the sheet(s) to copy and Edit / Move or Copy Sheet / Create a
Copy / and nominate the workbook to copy to

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup

THanks again. All working now. :)


All times are GMT +1. The time now is 11:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com