+ Reply to Thread
Results 1 to 5 of 5

Excel Marco to break the string to columns based on the "+" sign

  1. #1
    Registered User
    Join Date
    07-30-2010
    Location
    LA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Smile Excel Marco to break the string to columns based on the "+" sign

    Dear all,

    I am new to Excel Marco with very little programming background. I am asked to do a very simple task from my boss but it would be very time consuming if I cant' figure out this Marco to easy my daily task. Any feedback/input will be appreciated. What I am asked to do is to break the string to different columns whenever there's the "+" sign in the string.

    Thanks,

    Ric

    String column A column B column C column D
    AAA AAA
    AAA+BBB AAA BBB
    AAA+BBB+CCC AAA BBB CCC
    AAA+BBB+CCC AAA BBB CCC DDDD

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Excel Marco to break the string to columns based on the "+" sign

    Have you tried using Text to Columns feature ?

    Highlight Column A -> Data -> Text to Columns ... run Delimited -> Other and enter + click Finish.

    If you need a Macro - record yourself doing the above.

  3. #3
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Excel Marco to break the string to columns based on the "+" sign

    Hello,

    I an not sure where your orignal string is comming from though this code will run based on cell A1.

    If all your strings are in column 1 could could simpley loop the range.

    If you have any other needs or cannot figure out how to get this working can you please provide a sample workbook.

    Thanks

    Please Login or Register  to view this content.


  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Excel Marco to break the string to columns based on the "+" sign

    Quote Originally Posted by D_Rennie View Post
    Hello,

    I an not sure where your orignal string is comming from though this code will run based on cell A1.

    If all your strings are in column 1 could could simpley loop the range.

    If you have any other needs or cannot figure out how to get this working can you please provide a sample workbook.

    Thanks

    Please Login or Register  to view this content.
    Why reinvent the wheel ? ;-)

  5. #5
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Excel Marco to break the string to columns based on the "+" sign

    Have you never seen the guys/girls that get around in the doof doof cars, and their spinning hub caps, 22" shined metal mags. And dont forget the 10cm exhaust pipes.

    Actually i forgot that xl had that function. One day i will actually do something the easy way.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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