Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comparing Spreadsheets to find information

I have two spreadsheets. The master one has cost centers,
city and states. The second one has staff names and cost
centers. I need to pull in from the master the city and
state for each staff member (i'm talking about 4,000
people). Is there a way I can have a macro or something
go to the master worksheet and search for the cost center
and if found pull in the city and state for that person?
If I have a macro I don't mind doing it line by line (well
I do, but can't think of a faster method).

HELP PLEASE!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comparing Spreadsheets to find information

Hi Jini

You Could use the VLOOKUP Function for this

Something Like

=VLOOKUP($A1,Master!$A$1:$C$10,2,FALSE)

Where $A1 is the Value you Want to Match
Master!$A$1:$C$10 is the Table where your data is held
2 to tell which Column to Show
And FALSE to Search for Text Exactly

Just Change the Values to what you need

HTH
Davi

--
Message posted from http://www.ExcelForum.com

  #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


Reply
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:04 AM.

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"