+ Reply to Thread
Results 1 to 3 of 3

need to split string(s)

  1. #1
    Forum Contributor
    Join Date
    09-12-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    127

    need to split string(s)

    Looking for a code to use to split a string into 3 columns where the original data is all in 1 column and looks like this:

    JPAJ-24-SG,TR-K,LR-BP
    JTFT-1930-L,H-EC,HP-8J
    PPD-18
    QASS-36-BNS,TR-PLS
    QBBK-2336-L,H-WL,HP-WL
    3085-7007,TR-MC

    after it's split looks like this:

    Col 1
    JPAJ
    JTFT
    PPD
    QASS
    QBBK
    3085

    Col 2
    24
    1930
    18
    36
    2336
    7007

    Col 3
    SG,TR-K,LR-BP
    L,H-EC,HP-8J

    BNS,TR-PLS
    L,H-WL,HP-WL
    TR-MC

    basically need to find a way to split the string into three columns(if needed) based on the second "-" or if the "-" is a ","

    thanks in advance, s4

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: need to split string(s)

    Maybe:

    Please Login or Register  to view this content.
    Probably better ways.

  3. #3
    Forum Contributor
    Join Date
    09-12-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    127

    Re: need to split string(s)

    this is what i have come up with:


    Please Login or Register  to view this content.

    I am struggling to get one line in my code to be dynamic

    Please Login or Register  to view this content.
    thinking I just need right syntax for the destination:=range(???)


    any thoughts?

+ 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. Can excels Split() function split a string up at multiple spots?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2011, 02:36 PM
  2. Split string?
    By JapanDave in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-26-2011, 07:40 AM
  3. Excel 2007 : split string
    By APPLEBEE in forum Excel General
    Replies: 2
    Last Post: 06-29-2011, 02:29 PM
  4. how do I split a string twice?
    By Jeroen1000 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-18-2009, 04:18 AM
  5. Split a string
    By dealwi8me in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2006, 09:20 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