+ Reply to Thread
Results 1 to 5 of 5

substring out of a string

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    447

    substring out of a string

    Hi,

    I would like a macro that shows the substring between the last "\" and the first space in a string. How do i do this?
    e.g. the string "aaaaaaa\bbbbb\cccc\dddddd ggg ffff" should display "dddddd" in the column next to it.

    Any input is much appreciated!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,172

    Re: substring out of a string

    Try this
    Please Login or Register  to view this content.

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: substring out of a string

    Please try
    Formula
    =TRIM(LEFT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A2,"\",REPT(" ",90)),90))," ",REPT(" ",90)),90))

    UDF =lsl(a2)
    Please Login or Register  to view this content.
    or Sub

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    447

    Re: substring out of a string

    Thanks, works perfect

  5. #5
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: substring out of a string

    Hi
    Macro?
    Please Login or Register  to view this content.

    Or
    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. [SOLVED] Substring count in string with delimiters.
    By lil_ern63 in forum Excel General
    Replies: 8
    Last Post: 03-28-2019, 11:20 AM
  2. [SOLVED] How to get substring in a major string with VBA
    By ImranBhatti in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 12-14-2017, 12:07 PM
  3. Need help in extracting substring from string
    By juixyy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-14-2016, 05:28 AM
  4. [SOLVED] Copy a substring from a string
    By raul09 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-02-2013, 12:53 AM
  5. Finding a substring within a string
    By Michael D in forum Excel General
    Replies: 7
    Last Post: 02-21-2013, 04:01 PM
  6. [SOLVED] extract from string whole word(s) containing substring
    By Bearpecs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-24-2012, 10:37 AM
  7. Searching for a substring in a string
    By 1rovilla in forum Excel General
    Replies: 3
    Last Post: 05-07-2010, 08:17 PM

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