+ Reply to Thread
Results 1 to 9 of 9

Split Text and match it vba function

  1. #1
    Registered User
    Join Date
    04-07-2019
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    43

    Split Text and match it vba function

    I'm looking for a function from the formula. I hope that someone will help me.
    we want to search for such text "TP" and "IP" before the number.
    Attached Files Attached Files
    Last edited by jessica0007; 05-11-2019 at 10:21 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Split Text and match it vba function

    Hi,

    Are you looking for a User Defined Function in VBA which is equivalent to your formula?

    If so do you intend to leave B7 & B9:10 blank? I so what's the rule for ignoring A7 & A9:A10.
    Is it simply that the first two alpha characters must be followed by a numeric?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Split Text and match it vba function

    Hi,

    Here's one way

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-07-2019
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    43

    Re: Split Text and match it vba function

    Thank to the Reply,
    Yes, I am searching for functions similar to my formula.
    Perhaps you have not seen the entire formula, the formula is divided into three parts.
    In the first step, the text is divided by numbers and in the second step, the text matches "TP" or "IP", and in the third and final stage, if the text is not with "TP" or "IP" If the match is in such a situation, it will leave the empty cell.
    it is only to try to find such text "TP" and "IP" before the number.

  5. #5
    Registered User
    Join Date
    04-07-2019
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    43

    Re: Split Text and match it vba function

    This function does not work properly as my expectation.
    Attached Files Attached Files

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

    Re: Split Text and match it vba function

    B2
    =GetTPIP(A2)
    then filldown

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-07-2019
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    43

    Re: Split Text and match it vba function

    Thank you jindon, Yes that's it what i wanted.

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

    Re: Split Text and match it vba function

    You are welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Split Text and match it vba function

    Quote Originally Posted by jessica0007 View Post
    Thank to the Reply,
    Yes, I am searching for functions similar to my formula.
    Perhaps you have not seen the entire formula, the formula is divided into three parts.
    In the first step, the text is divided by numbers and in the second step, the text matches "TP" or "IP", and in the third and final stage, if the text is not with "TP" or "IP" If the match is in such a situation, it will leave the empty cell.
    it is only to try to find such text "TP" and "IP" before the number.
    Did you actually try the function? It provides the answers you show in your example.
    The function doesn't rely on any particular first two characters, it simply identifies whether there is a numeric in the 3rd position and if so returns the first two characters.
    If you have other data where the result needs to be different then plesae show it.

    See attached
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Match Function for Split Numbers
    By soleimani1967 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-02-2019, 02:05 PM
  2. Split text and combine it randomly (as function)
    By moosmahna in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-25-2016, 08:53 PM
  3. Replies: 4
    Last Post: 11-11-2015, 03:00 PM
  4. Replies: 4
    Last Post: 07-25-2013, 05:28 AM
  5. Replies: 5
    Last Post: 10-26-2012, 02:21 PM
  6. Replies: 3
    Last Post: 10-27-2010, 03:11 AM
  7. Split one cell into two by formula not text to colums function
    By robfink2.0 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2010, 02:28 AM

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