Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to switch between Word and Excel 1

Status
Not open for further replies.

Mklhayes

Programmer
Nov 26, 2002
12
0
0
US
I have 2 documents. Excel file has 32000 rows of data, Word file has 3661 pages of data. When I open the Word doc in Excel, it goes over the row limit. How can I write a code to take a value in excel, and search for that value in Word and return it to Excel?? Thanks
 
You'll need to be more specific about your problem (organization of the Word/Excel documents, etc).
Rob
[flowerface]
 
The Excel file lists transaction numbers and quantities, that came from a company. The Word doc came from an internal source, and also lists transaction numbers and quantities. The Word doc has a page header and skips alot of rows between the info. That is probably why it is to big to fit in Excel. I need to grab the transaction number from Excel and find it in Word, grab the quantity in Word and bring it back to Excel to compare the values to see if they are equal. I hope this helps. Thanks
 
I see two approaches: one is to do exactly what you are proposing. You'll need to set up one application as the main app running VBA code (probably Excel). Excel VBA would open Word and the Word document, and perform a search in Word, do some manipulation in Word, and retrieve the value you're after. Again, the exact implementation would depend on the organization of the Word document.

Alternatively, you could run a macro in Word to remove all extraneous information (empty lines, etc) to get it down to a size you can import into Excel. This is certainly the way I'd go if you need to run a lot of these queries on the same large file.
Rob
[flowerface]
 
Thanks for your time. I ended up importing both in to Access and building the code there. I appreciate your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top