VBA to extract data from 2 excels

S

sphereatmo

Hello,
I am completely new to excel vba and still learning.

I have 2 excels and I want to extract data using VBA based on match
criteria on 2 columns. That is:

Excel1 has these 4 columns JoinDate, FirstName, LastName, Address.

Excel2 has these 9 columns: Transaction Type, Transaction Date,
Transaction Number, FirstName, LastName, ProductCode, ProductName,
Product Date, Payment Amount.

I would like to:

1) Read Excel1 sequentially
2) For every row having FirstName, LastName, find matches for the same
FirstName, LastName in Excel2
3) Please note that Excel2 can have multiple rows matching for
FirstName and LastName. I want to extract all the relevant rows
matching with FirstName and LastName
4) Once the match is found, I want to extract these data: ProductCode,
ProductName & TransactionDate and output to a 3rd excel, Excel3.
5) Excel3 format is: FirstName, LastName, ProductCode, ProductName,
TransactionDate.

Need help to code this using VBA? Appreciate anyone sharing sample VBA
source on this

Thanks
sphereatmo
 
D

Doug Robbins - Word MVP

I suggest:

1. That you post questions about using VBA in Excel to the
microsoft.public.excel.programming newsgroup (This one is for the questions
on the use of VBA in Word.)

2. That you copy the Excel data into separate tables in Access, then
create a query that links the two tables on the relevant fields.

Databases are much better at manipulating data that word processing or
spreadsheet programs.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top