Posted to microsoft.public.excel.programming
|
|
Edit String Variable "on the fly"?
OK, thanks. I take it you got it solved then.
RBS
"Dave Birley" wrote in message
...
Thank you for your reply. It is interesting that you appear to be the only
one of the three respondants who read my full message including ..
«using (among other things) InStr against a search string variable.»
Therefore I am working with (as you correctly read) a single string, not
an
array of strings. Had I used an array of strings, the other answers would
have had possibilities, but I am using it in a Case of a Select Case
construct, and an array or series of strings won't cut it.
The Case construct works like this:
Select Case True
Case InStr(strCodeList, strMyCurrentSearchItem)
<yadda, yadda
Select End
The problem is that on each WS the data is sorted by Newest at the top.
The
contents of an item for that latest period (say month 9) are **supposed**
to
contain the contents of that same item for the preceding two periods (8,
7).
**However** this is really bad data, and sometimes the items were not
carried
forward (we're talking data that ends in 2003 Q4), so I have to look for
an
item in the latest date. If I find it, then I need to stop looking for it,
but if I don't find it, I need to look in each of the other periods. If I
still don't find it, I go to the next previous WS.
Rick Rothstein (MVP - VB) quite reasonably stated that i didn't give
enough
information, but somehow, despite that lack you nailed the exact answer I
was
needing. So I thank you, but I also thank Norman and Rick -- the community
here has made my transition from 20 years of VFP to about 6 weeks of VBA a
relatively painless one <g!
--
Dave
Temping with Staffmark
in Rock Hill, SC
"RB Smissaert" wrote:
How about simpy:
strSearchList = Replace(str, ", REG", "", 1, -1, vbBinaryCompare)
RBS
"Dave Birley" wrote in message
...
I am evaluating a relatively large data set by using (among other
things)
InStr against a search string variable.
Dim strSearchList As String
strSearchList = "ROL, REG, OT-, PN2"
On each pass through a sub-process where this is used other qualifying
factors are evaluated. Once all qualifying factors are met, the "found"
item
in the string is "used", but must be ignored on subsequent passes
through.
So, if I process for the "REG" element, what I need to do is re-state
strSearchList as "ROL, OT-, PN2" -- that is, with the "REG" removed.
So how do I do that?
--
Dave
Temping with Staffmark
in Rock Hill, SC
|