VB macro for extracting text from Excel files

doropeter

New Member
Joined
Feb 10, 2005
Messages
9
Hi!
I've been trying to come up with a macro to search for specified information in a bunch of excel files, then if the search text is found, then extract the entire row to an other workbook.
To explain it a little bit more detailed: I have 1500 excel files, (each having only one worksheet in it), each file has the exact same structure.(25 columns, and a varrying number of rows, 10 to 500). Files contains sales information. Each customer has his purches information in a separate file. In the files each sale event is recorded in separe row. In column 21 the name of the product is recorded.
My goal is to find all sales of a certain product. For example I have to find all sales of bandaids. So in each of the 1500 files I have to search for the word "bandaid". There can be customers who have not bought any, and there are customers who had it 30 different times. So I have to find these cells, then I have to copy the entire row (all the information about that sale event) to a separe workbook.
Therefore finally I should have one worksheet that has all the sale event of bandaid.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Best bet would be to create a simple table from your workbooks and then query the database. Email an example workbook or post it here. mrexce@fuse.net

Tom
 
Upvote 0
Hi Tom,
Putting all the files in one workbook won't work, as the number of lines are far beyond the limits of an excel workbook.
But finally I could solve the problem, and I created the macro that does the job.
If you are interested in it, I can e-mail it to you.
Peter
 
Upvote 0

Forum statistics

Threads
1,206,814
Messages
6,075,008
Members
446,114
Latest member
FadDak

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top