+ Reply to Thread
Results 1 to 6 of 6

Extract String from between 2 same characters

  1. #1
    Registered User
    Join Date
    09-30-2010
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    33

    Extract String from between 2 same characters

    Hi, I am a beginner in VBA and I am wondering how to extract a string that in in between 2 same characters.

    I have a string in the format of ABC.DEF.12.345 in A1 on Sheet2

    I need extract the text from Sheet2 and write them into cells in Sheet1 to put ABC in A1, DEF in B1, 12 in C1 and 345 in D1.

    I have solved the first one by:
    Please Login or Register  to view this content.
    I am unsure as to how to solve the rest though, thank you very much!
    Last edited by alansidman; 09-30-2014 at 05:51 AM. Reason: code tags added

  2. #2
    Registered User
    Join Date
    01-04-2013
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: Extract String from between 2 same characters

    Hi

    Does this need to be in VBA? As you can place a formula in the cells a1 b1 c1 and d1 to this exact function

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,755

    Re: Extract String from between 2 same characters

    Why not just use the built in Excel functionality of Text to Columns with a "." as your delimeter?
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,755

    Re: Extract String from between 2 same characters

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Extract String from between 2 same characters

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  6. #6
    Registered User
    Join Date
    09-30-2010
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    33

    Re: Extract String from between 2 same characters

    Thanks! This is exactly what I am looking for!

    Quote Originally Posted by :) Sixthsense :) View Post
    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)

Similar Threads

  1. Extract special characters from a string
    By Nadine74 in forum Excel General
    Replies: 3
    Last Post: 04-17-2014, 01:41 PM
  2. [SOLVED] Extract left characters from string with exception of 2 right characters
    By sweetkel23 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-16-2012, 10:45 PM
  3. [SOLVED] Extract 1-2 characters from a string
    By sweetkel23 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-14-2012, 07:53 PM
  4. EXTRACT all characters from a string
    By Blake 7 in forum Excel General
    Replies: 2
    Last Post: 03-11-2011, 07:06 AM
  5. Extract trailing string of characters from a URL
    By cmckenzie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-28-2009, 04:39 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