LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Comparing Spreadsheets to find information

The easy solution is to use SQL. The first problem is that you have 2 data sources (workbooks).

1. Use Excel as an automation server, open each workbook and save the relevant sheet in each in CSV format (if it is a one off, you can do this manually)
2. Use the ODBC text driver to read each CSV and to join them
3. Write the resulting recordset to a CSV or write it directly to a workbook. (lookup CopyFromREcordset in the Excel VBA help file)

On 2: (this is the (untested) code you want

Cnn ="Provider=MSDASQL;Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=c:\;
Sql = "SELECT * FROM FIRST.CSV a,SECOND.CSV b WHERE a.[Cost centre]=b.[Cost Centre]
Set RS = CreateObject("ADODB.Recordset"
RS.Open Sql, Cn


 
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
Comparing two spreadsheets barb Excel Worksheet Functions 2 January 20th 10 04:45 PM
Comparing two spreadsheets with pricing information sta1 Excel Worksheet Functions 5 March 5th 09 09:15 PM
Comparing Spreadsheets Richard Excel Discussion (Misc queries) 1 January 17th 07 05:56 PM
Comparing two spreadsheets Freddo Excel Worksheet Functions 2 May 2nd 06 11:40 AM
Comparing spreadsheets JT[_2_] Excel Programming 1 April 20th 04 06:13 PM


All times are GMT +1. The time now is 04:01 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"