+ Reply to Thread
Results 1 to 4 of 4

Using the .Pattern Method for identifying Strings

  1. #1
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Question Using the .Pattern Method for identifying Strings

    Hi Guys,

    I'm looking to implement the .Pattern method for Identifying Parts of String terms.

    Basically I am looking for the Initials of a persons name from within a string.

    Here are a few examples of strings where im trying to find the initials of the employee in:
    1- "1700049757 WC- West Bull & Union DKT30868 08.00am " Here the initials to find are WC
    2- "FSNe12265 - AD-JEWELLS 8687 D.C. HC01291" Here the initials to find are AD

    Here are a few examples where I dont want to mistakenly find initials (Which don't exist within the string)
    1- "A2027-replacement IV-90041. (LL - peal taps on ABS1291)
    2- "A3040-Run ABC IV-90038 to IV-90041 & connect. Changeover; replace SL; remove OW etc"


    In order to Identify the Initials the following conditions are always obeyed:
    1. The Initials start and Finish with either a Space or a Dash (Can start with a space, finish with a dash, OR can start with a Dash and finish with a dash, ... All combinations of these)
    2. The Length of the Initials is at Most Less than 5 Characters. (Due to some employees having the same 2 character initials some strings contain additional letters to identify on employee with the same initials to another employee, I.e. John Smith = JS, James South = JS... These initials would appear something like :JS, JSou
    3. The initials Always start with numbers before them And before Point 1.
    4. The first two characters of the Initials are Always Capitals


    Please refer to my other post that is related to this question - Found Here: http://www.excelforum.com/excel-prog...ple-cases.html

    Jordan

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Using the .Pattern Method for identifying Strings

    Try this
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Using the .Pattern Method for identifying Strings

    Thanks Jindon!

    I have another question for you.. Suppose I Use the above pattern and build a list of all the Initials that have been found.

    After this list has been built and saved to a range on a worksheet, could I use the .pattern method to compare what it thinks it has found as the initials with all the cells in the list.

    I could use a loop to search through the values found in this list of initials on my worksheet and compare each one with what is found using the .pattern method, but I want to see if you know of a better way to achieve this

    If it doesnt exist in the list then Add the new unique value to the list.

    My goal with this is to be able to build a list of all the found initials. Since I will be using this over a long period of time it will incollate a historical list of all the initials that have been found.

    Now that I have a list which contains all the previously found initials I can now use it as a 'backup'. If the .Pattern function doesn't Identify any initials then I plan to create a backup search function to then compare all the previously found initials with the string. This is to provide additional redundancy in the case that the initials don't appear in the string in the location in which the .Pattern function expects to find it.

    Jordan
    Last edited by jordan2322; 03-13-2013 at 07:19 PM.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Using the .Pattern Method for identifying Strings

    Do you mean like this?
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1