Ron said:
Yes I guess I should have posted a bit more of my data file because
there are records with aU au AU Au so I need to find variations. some
do not have the dash because people make mistakes.
So I can get a better idea lets say for example I want to find more
than one letter both upper and lower of that letter.....lets say find
Vowels Aa, Ee, Ii, Oo, Uu in that text file, then I can change them
to fit my needs.
How would I go about rewriting the ptrogram to go through and find
vowels no matter where they are part number or not and then they would
count them highlight them green etc.... this way I can then modify to
find the combinations I need. This will give me an idea of how to
find differant combinations.
OK, looks like you're moving right away from what you originally asked
for. Right now I would forget about letters (Vowels or otherwise) and
take a completely different approach.
From what you posted in your other thread, it looks like the unique
character is in fact the hyphen ("-"). I can only go by what you
posted, and if it is correct, then we simply need to look for that.
The modified code for the Loop is therefore -
Do
iStartPosition = InStr(iStartPosition + 1, RichTextBox1.Text, "-")
If iStartPosition > 0 Then
iEndPosition = InStr(iStartPosition, RichTextBox1.Text, " ")
RichTextBox1.Select(iStartPosition - 3, (iEndPosition -
iStartPosition) + 2)
iStartPosition = iEndPosition
RichTextBox1.SelectionColor = Color.Green
iPartNumberCounter += 1
End If
Loop Until iStartPosition = 0
MsgBox(String.Format("Number of Product Codes = {0}", iPartNumberCounter))
This relies on the fact that you've only ever shown or mentioned two
characters preceding the hyphen. If this is not the case then please
post a thorough sample of the Text File, containing a good example of
the variations, so everyone can have a better idea of exactly what
you're trying to read.
ShaneO
There are 10 kinds of people - Those who understand Binary and those who
don't.