+ Reply to Thread
Results 1 to 4 of 4

Separate data in a Cell using Macro.

  1. #1
    Registered User
    Join Date
    10-07-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    30

    Separate data in a Cell using Macro.

    Hi guys, I need help here.

    I got a column of data in format as below:

    Column 1:
    ABC - AC123
    ASD - DS335
    BBC - KK311
    SWT - TR735
    TIM - DN849

    Between two texts to be separate, there is a " - ", we can separate them with that symbol right?..The cells should be look like after separate shown belows:

    Column 1:
    ABC
    ASD
    BBC
    SWT
    TIM

    Column 2:
    AC123
    DS335
    KK311
    TR735
    DN849

    What is the macro code to do this, anyone can help me?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,093

    Re: Separate data in a Cell using Macro.

    Why don't you just use Text to Columns? Record the manual steps if you want a macro.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Separate data in a Cell using Macro.

    You don't really need a macro to do that

    put this in column B
    Please Login or Register  to view this content.
    and this in column C
    Please Login or Register  to view this content.

    If you really want a macro, try running this:
    Please Login or Register  to view this content.

    Edit: or as TMShucks suggested, use text to columns
    Totally forgot about that.
    Last edited by millz; 02-10-2014 at 09:39 PM.
    多么想要告诉你 我好喜欢你

  4. #4
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Re: Separate data in a Cell using Macro.

    Try this...

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. Change cell value that has data validation from list in a separate sheet with macro?
    By jimmyjackjoejames in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2013, 11:31 AM
  2. Macro to copy row data into new worksheets and separate delimited data
    By asuguy83 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-25-2012, 08:11 PM
  3. [SOLVED] separate data from one cell into two separate cells question
    By lilsnoop in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-19-2012, 05:53 PM
  4. [SOLVED] Macro to separate out raw data
    By jph89 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-22-2012, 07:34 PM
  5. Macro that saves cell data to a separate spreadsheet and clears cells?
    By peepo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-16-2010, 10:47 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