+ Reply to Thread
Results 1 to 3 of 3

Splitting strings if a character is present within them

  1. #1
    Registered User
    Join Date
    05-06-2010
    Location
    Derby
    MS-Off Ver
    Excel 2007
    Posts
    9

    Splitting strings if a character is present within them

    Hi there,

    I have a workbook with some text I really need to tidy up, so it'll be accepted by a program I use.

    Some sort of SPLIT function could do it - but there's an added twist.

    Before I launch into a confusing description, here's an illustration of the desired effect:

    BEFORE
    Title: Love Can Build a Bridge
    Performer: Cher/Chrissie Hynde/Neneh Cherry

    AFTER
    Title: Love Can Build a Bridge
    Performer: Cher
    Performer: Chrissie Hynde
    Performer: Neneh Cherry

    So - I’d like a macro that looks through the active workbook area (it’ll only be Column A.)
    If it finds a string that starts “Performer: ” AND contains the character “/”, it should split this string using the “/” as a delimiter.
    It should create a new row below, where it should place the portion of the string that was after the delimiter. (Ideally, it would trim off any leading space too.)

    Importantly, every cell containing a fragment of the original string needs also to start with: “Performer:”.

    Multiple “/”s in the string would mean multiple new rows beneath, to hold the resulting substrings.

    There's a workbook attached with a lengthier example.
    performer-splitter.xlsx

    Thank you for any help you can give,
    Matt

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Splitting strings if a character is present within them

    Matt - this puts results on a sheet2:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-06-2010
    Location
    Derby
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Splitting strings if a character is present within them

    Thanks very much Stephen - and sorry for the slow response.

    That worked just as I hoped. Have a great weekend,

    Matt

+ 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. Comparing Strings Character by character
    By Padhu9488 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2014, 06:17 AM
  2. Replies: 9
    Last Post: 10-01-2013, 04:37 AM
  3. Convert ASCII Character strings into HEX Strings
    By Chris Mathers in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-13-2010, 12:25 PM
  4. Splitting Strings
    By jay_hl123 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-23-2007, 01:50 PM
  5. splitting strings
    By tad_wegner in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-27-2006, 12:10 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