+ Reply to Thread
Results 1 to 5 of 5

Splitting a cell at a certian character

  1. #1
    Registered User
    Join Date
    06-09-2004
    Posts
    29

    Splitting a cell at a certian character

    So, I have some cells that contain data like this:
    ABCDE: @ CT 8:59 1)Text Data One 2)Text Data Two 3)Text Data Three.

    I want to split up the cell so that the each set of data is in its own column.

    I thought I could just use Text to Columns on the ")" sign but some of the data could actually contain parenthesis.

    So I need a way that it can actually look for "1)" or "2)" or "3)" and do the split at that set of characters.

    Can anyone assist me with this?

    Thanks!

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,612

    Re: Splitting a cell at a certian character

    As you are in the VBA forum, do you need a VBA solution?

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Splitting a cell at a certian character

    Select the Cell(s) and run the code
    Please Login or Register  to view this content.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Splitting a cell at a certian character

    ....but some of the data could actually contain parenthesis.
    Then best you post a workbook with a sample of your data, and any variations.

    This type of question invariably leads to ... but what if my string has ..... ?

  5. #5
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Splitting a cell at a certian character

    kelemvor,

    I see that jindon has done it again. Nice - I have to learn how to use patterns.


    With your raw data in the active sheet, beginning in cell A1.

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the SplitOnClosedP macro.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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