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>
 
Ahh... missed one Trim

Rich (BB code):
       If .exists(Trim(a(i, 1))) Then a(i, 2) = .item(Trim(a(i, 1))) : .remove Trim(a(i, 1))
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Ahh... missed one Trim

Rich (BB code):
       If .exists(Trim(a(i, 1))) Then a(i, 2) = .item(Trim(a(i, 1))) : .remove Trim(a(i, 1))


Adding this line seems to reduce the amount of cells that get populated.

Nevermind- I entered it incorrectly. It works perfectly now. Thanks Seiya!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,217,382
Messages
6,136,239
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