+ Reply to Thread
Results 1 to 5 of 5

Macro to separate data

  1. #1
    Registered User
    Join Date
    03-10-2010
    Location
    North Carolina
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question Macro to separate data

    I'm looking for a macro that can take data that is in one cell with hard returns between the fields and separate it into columns. I need like data in the same columns. For example, my cells might look like this:

    "EXISTING INFO
    Route 11
    BFO576(R)
    3.6 kft"

    I need 4 columns from this data, but the next cell might only have 3 pieces of that information, but I need all of the "ROUTE" data in one column, all of the "BFO" data in a column and all of the "kft" in one column so that I can sort by any piece of that puzzle.

    How could I do this if all cells don't contain all 4 pieces of the puzzle?

    Many thanks in advance!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Macro to separate data

    Welcome to the forum.

    Post a workbook with some examples of the data.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-10-2010
    Location
    North Carolina
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Macro to separate data

    Here is a workbook example. Thanks so much!
    Attached Files Attached Files

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Macro to separate data

    Try this:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-10-2010
    Location
    North Carolina
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Macro to separate data

    That worked beautifully - except for the cells with three lines in them - they skipped the BFO sections when they separated - any idea why?
    Last edited by MyBabyO; 03-10-2010 at 03:10 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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