Evaluate a variable string, return part of it to a new cell - vba or inherent fx? excel 2007

exl_wiz

New Member
Joined
Apr 8, 2014
Messages
5
Hi there.. I have a column which contains notes exported from a database. The notes are formatted with pipes as delimiters, there maybe 5-10 notes (delimited strings) in each cell of Col N. Each string will also contact a timestamp and the person's name who wrote the note, and the pipes appear at the start of each unique comment in the note string (before the emp name and timestamp).

I need to loop through each cell in this col, eval the whole string looking for a comment that contains canned text like "|*M: Expense approved - *. |"

the actual comment in the cell would have been like "|Bob Smith 1/1/2011 1:11 PM: Expense approved - Payee Name $0.00. |next note, etc."

so I want to look between the pipes for a note containing expense approval, and extract just that sentence including emp name and timestamp, payee and amt to a new cell in Col H.

VBA is ok, would like an in-cell function if there's a way to do this. I have countifs (as boolean) just to flag the presence of the constant part of the string "expense approved", but I have no idea how to pull out the sentence between the pipes where the constant matches..

suggestions?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi exl_wiz,

Can you give a particular example of a whole comment with all the notes and then what the solution would look like for that cell?
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,101
Members
449,096
Latest member
provoking

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