Extract text plus "n" characters or date on partial match
Thanks for your answers.
Well, my first post, effectively, was not so clear.
My situation is:
W2K+Excel2003
I have a worksheets with thousands of rows data, in the first column
there is a text like:
der. husky b/n f 4 aa. rmd 2161 huma - p.p. adopted 10.02.04
dobermann n/f m. steril+rmd24378 faruk - p.p. trasf. palombara 13/1/05
I need to extract (copy-paste) to a different column, the text it
matches the criteria:
-Start with RM
+ Have a third different character ("D" or "A" or "E" etc.)
+ Have a sequence of four or five numbers, sometimes preceded by a
<space.
The results sound like "rmd 2161" or "rmd24378" or "rme45758".
Having a working formula for the above first case, I tought to re-use
it, adapted, for my second "challenge":
extract dates looking for their previous word always is present and
insert it in one of two different column:
if "adopted" or "ado" or "adopt." is found with "*ado*" then the
following date must to be copy-past to column K (Exits).
if "re-entered" or "re-ent" or "reenter." is found, the following date
must to be copy-past to column J (Entrances).
Anyway I found that sometimes there are two key words and two dates,
then I suppose I need a third "L" column, but, at current time, it's
important to extract only the last date.
Now I'm trying your formulas, It seems to me that the merjet one could
suit my needed but it returns
"Run-time error '5': Invalid Procedure Call or Argument"
at this point:
char = Mid(sstr, iPos1, iPos2 - iPos1)
and I found, looking for, in the newsgroups, it could be a problem of
mid with InStr.
Thank again for your help!
FabZ
|