PDA

View Full Version : Find, Copy Text from Word and paste in excel



abhijitdas
02-08-2013, 04:03 AM
Hello all,

We have over 3000 pages in a word document that are letters of this format.



Reference No:BANGA06254J1/JAN/2013 Date:31-JAN-2013

MATHEW JOHNSON
C.B.192,SECTOR-5
SALT LAKE CITY .
BANGALORE 560 064.


Dear Sir/Madam,

Payment of Pension for the month of JAN/2013.
We advise that an amount of Rs.***9365.00


......the rest of the letter follows.



What we need to get into excel is the name and address(in a single cell together as in the letter itself) in the next available row and then repeat it till the end of the document.


Thanks a lot.

macropod
02-08-2013, 04:10 AM
There have been numerous posts on thios board, both in this forum and in the Integration/Automation forum dealing with copying & transferring data from Word to Excel. I suggest you do a search and go to work with one that approximates your needs. If you run into problems, come back with the code you're using and tell us what the issues are.

abhijitdas
02-08-2013, 08:46 AM
Thanks a lot for your reply Paul. I must confess I am a total newbie to VBA. I'm a total marketing guy with this job at hand right now. I did research a bit on this and the closest I got is at this thread - http://www.vbaexpress.com/forum/showthread.php?t=42850 , however to be honest it's difficult for me even to tweak the code in that to my needs. :) I hope you understand. Any help will be appreciated. Thanks again.

macropod
02-08-2013, 04:48 PM
before going down the data extration path, I must comment that it sems to me your data are the result of a mailmerge or a database report. In that case, it would be far more efficient to go back to the data source and extract the information, in the required format, from there.

abhijitdas
02-09-2013, 01:09 AM
Yes, it is the result of a mail merge. Sadly, the data source has been misplaced by the creators. So, this is the only way left with me, other than copying the data manually.

Cheers
Abhijit

macropod
02-10-2013, 04:11 PM
OK, before a solution can be implemented, you'll need to provide some more detail about the data to be captured. For instance:
• is each 'letter' separated by a Section break, and is there only one such break per letter.
• how are the start and end of each address block to be identified (eg always starts after the 2nd paragraph break on the page and terminates with a following empty paragraph.
A sample document attached to a post showing some representative data would be useful (delete/modify anything sensitive).