Search Word for text and send values next to text to Excel file

fordma2831

New Member
Joined
Apr 29, 2009
Messages
13
This is my first post and I am not certain that I have exhausted the search function on the board, but I was hoping someone could point me in the right direction. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
I am using Windows XP and Office 2003. <o:p></o:p>
<o:p></o:p>
I am looking to automate a process where information is sent to someone in a text format and they in turn transfer that data to an excel file. It basically looks like this (but includes a lot more info):<o:p></o:p>
<o:p></o:p>
Service Request #: 123456<o:p></o:p>
Instrument Type: New Instrument<o:p></o:p>
Lot/Serial #: 123456<o:p></o:p>
SR Type: Product Complaint<o:p></o:p>
Service Coverage: Maintenance Agreement<o:p></o:p>
<o:p></o:p>
The info on the left (text preceding the colon) is always the same but the values following the colon can change. The excel file has all of the text before the colon and they just enter the information into the cells. I am looking to make it so that an Excel macro (or maybe a word/outlook macro) automatically scans the text document and sends this info to the exact same cells in excel every time. <o:p></o:p>
<o:p></o:p>
The text file is actually a message from an Oracle database and I am not going to be able to make any changes to the way the data comes in. <o:p></o:p>
<o:p></o:p>
My only real experience with VBA is from recording macros and looking at them in the editor. I did just pick up a book though...<o:p></o:p>
<o:p></o:p>
Does this seem feasible? <o:p></o:p>
<o:p></o:p>
Thanks for the help. <o:p></o:p>
<o:p></o:p>
Matt <o:p></o:p>
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
but includes a lot more info
What kind of more info ?
Rich (BB code):
automatically scans the text document and sends this info to the exact same cells in excel every time

Does this mean the document from Oracle is not in order everytime ?
 
Upvote 0
open the text file in excel hit record macro then highlight column a, then go to Data -> text to Columns -> Select delimited -> go to next screen -> and check on semicolon for the delimeter hit finished.

This will produce the recorded macro for you.
 
Upvote 0
Sorry. The more info is actually just more text with fields that follow. It is exactly the same format as what I posted but it is jsut 3 times longer in real use.

All of the fields from Oracle are in the same order and the text before the colons are the same, the values that follow are different with every message. The excel file that enter the data into is basically a form, so the people enter the data into the same cells every time. The macro would hopefully just speed this up and reduce errors.
 
Upvote 0
Sorry. The more info is actually just more text with fields that follow. It is exactly the same format as what I posted but it is jsut 3 times longer in real use.

All of the fields from Oracle are in the same order and the text before the colons are the same, the values that follow are different with every message. The excel file that enter the data into is basically a form, so the people enter the data into the same cells every time. The macro would hopefully just speed this up and reduce errors.

Hummm

What do you want to do with the macro?

Create a txt file ?
Populate the cell(s) from the text file ?
 
Upvote 0
Just populate the cells from the text file. I am working on using the text import idea that Ed in Aus gave me. It definitley a good idea but I am not sure that it will work long term since it is a few extra steps and 95 different excel novices will be using this process.
 
Upvote 0
Eliminate the users, control the macro from one location then redistibute the output to the other users... something like a generic email account that they all have access to maybe.

can you get that .txt file sent sent to a location? like a folder that none of the users have access to then set the macro to run every 5 mins?

not sure if this is going to help but I have had to do something like this in the past from an oracle database out put into another one.
 
Upvote 0
Ok

How do you exactly want to do?

1) You have already populated the headings in col.A
2) Read the text file and place the corresponding data in col.B

Is this what you wanted ?
 
Upvote 0
Ok

How do you exactly want to do?

1) You have already populated the headings in col.A
2) Read the text file and place the corresponding data in col.B

Is this what you wanted ?

I was really looking to see if there was a way to scan a file for specific terms and then return a string of values following that term. Then, copy the string and send that string to a specific cell in excel. Sorry if I am not helping much here by being a little vague.

The data import method certainly works and I hadn't really explored that part. I guess the only concern with that one is if something changes in the formatting of the text file and then that impacts how the excel file is created. I haven't tried it enough yet to know though.
 
Upvote 0

Forum statistics

Threads
1,217,381
Messages
6,136,228
Members
450,000
Latest member
jgp19

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