LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #17   Report Post  
GrayesGhost
 
Posts: n/a
Default

JV,

Thanks for the info, but that is a little too complicated for me. I'm doing
a very simple operation and it would take me longer to learn and implement
those formulas than it would for me to simply open the old workbook, do a
copy/paste, then close and delete the source file.

Take Care - GG

"JVLin" wrote:

Hi,

I posted a similar question a few weeks ago on the programming part of this
forum.

I got this answer from Jamie Collins:

can I copy data from one workbook to another (or for that matter
from within a workbook) WITHOUT OPENING EACH WORKBOOK?


If your data is arranged as a database (i.e. rows of columns,
preferable with column headers) then yes.

A simple example to copy the entire contents of one table (worksheet)
to another workbook where the table does not already exist:

SELECT
MyKeyCol, MyDataCol
INTO
[Excel 8.0;HDR=YES;Database=C:\My
Folder\MyTargetWorkbook.xls;].[Sheet8$]
FROM
[Excel 8.0;HDR=YES;Database=C:\My
Folder\MySourceWorkbook.xls;].[Sheet8$]
;

A more complex example where the table does already exist in the
target workbook and you only want to append non-duplicated rows:

INSERT INTO
[Excel 8.0;HDR=YES;Database=C:\My
Folder\MyTargetWorkbook.xls;].[Sheet8$]
(MyKeyCol, MyDataCol)
SELECT
T1.MyKeyCol, T1.MyDataCol
FROM
[Excel 8.0;HDR=YES;Database=C:\My
Folder\MySourceWorkbook.xls;].[Sheet8$] T1
LEFT JOIN
[Excel 8.0;HDR=YES;Database=C:\My
Folder\MyTargetWorkbook.xls;].[Sheet8$] T2
ON T1.MyKeyCol=T2.MyKeyCol
WHERE
T2.MyKeyCol IS NULL
;


I have to admit this code is too complicated for me, but perhaps you can
find some use for it. If not: perhaps you can ask Jamie to explain!

JvLin

PS The question I posed also pertained to getting a collection of worksheet
names from unopened workbooks.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Data from unopened Workbook into an open Workbook GrayesGhost Excel Discussion (Misc queries) 0 March 5th 05 11:25 PM
grand total column B from every worksheet in workbook igor Excel Discussion (Misc queries) 2 February 23rd 05 08:42 PM
How to open a workbook with a specific worksheet displayed by defa ThaiNB New Users to Excel 2 January 21st 05 06:11 AM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM
Importing worksheet from different workbook Wes Excel Discussion (Misc queries) 2 January 18th 05 04:05 PM


All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"