• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 142
  • Last Modified:

How to find patterns..?

I want to be able to convert Name fields of this format:
"Hey Christmas Puppets (050101_020_01) hey again"

I want have it look for everything between () and do this..

Into:
Name: Hey Christmas Puppets
TESTSET: 050101
TESTPLACE: 020_01

Any Suggestions..
0
sdesar
Asked:
sdesar
1 Solution
 
sellisonCommented:
Public Sub Foo(strInput as String)
Dim strName as String
Dim strTestSet as String
Dim strTestPlace as String

strName = Left$(strInput, Instr$(1, strInput, "(") - 1)
strTestSet = Mid$(strInput, Instr$(1, strInput, "(") + 1, Instr$(1, strInput, "_") - 1)
strTestPlace = Mid$(strInput, Instr$(1, strInput, "_") + 1, Instr$(1, strInput, ")") - 1)

End Sub


Not sure exactly if this is what you are trying to do or not.  If not, can you clarify a bit?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now