+ Reply to Thread
Results 1 to 5 of 5

Help Separating Words in one column to two columns

Hybrid View

  1. #1
    Registered User
    Join Date
    07-15-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    2

    Help Separating Words in one column to two columns

    So i have a list of data in one column, in which each cell contains an author followed by an underscore followed by the description. There is a range of 3 different authors and a range of about 20 different descriptions that could be in each cell. My hope is to expand the one cell to two different cells, one with author and one with description.

    EX:

    |"auth_desc"| --->>> | "auth" | "desc" |

    I've been regularly viewing threads on these forums for a while and could probably find a way to get it to work if I had the slightest clue about how to start, so any ideas would be very helpful.

    Thanks in advance.
    Last edited by thedirebear; 07-15-2013 at 03:50 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Help Separating Words in one column to two columns

    Assuming the information is in cell A1:
    For Author use this formula: =LEFT(A1,FIND("_",A1)-1)
    For Description use this formula: =RIGHT(A1,LEN(A1)-FIND("_",A1))

    If the information is in column A, you can put the Author formula in column B and Description formula in column C, copy the formula down as needed
    Click on star (*) below if this helps

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Help Separating Words in one column to two columns

    In excel 2010 highlight your data, go to data tab and click text to columns using the under_score as a deliminator.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  4. #4
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: Help Separating Words in one column to two columns

    Another option is this:
    If all cells contain only 4 letters for the author and 4 letters for the description, then this may work
    Sub split()
    
    Dim list1 As Range
    Dim listnumber As Long
    
    Range("D1").FormulaR1C1 = "=COUNTA(RC[-3]:R[10000]C[-3])"
    Range("D1").Select
    listnumber = ActiveCell.Value
    ActiveCell.ClearContents
    
    Application.ScreenUpdating = False
    
    For Each list1 In Range("A1:A" & listnumber)
        list1.Offset(, 1).Select
        ActiveCell.FormulaR1C1 = "=MID(RC[-1], 1, 4)"
        ActiveCell.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        
        list1.Offset(, 2).Select
        ActiveCell.FormulaR1C1 = "=MID(RC[-2], 6, 4)"
        ActiveCell.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    
        If list1.FormulaR1C1 = "" Then Exit For
     
    
    Next list1
    
    Range("B:C").Cut
    
    Range("A:B").Select
    
    ActiveSheet.Paste
    Application.ScreenUpdating = True
    Range("A1").Select
    
    End Sub
    ~~LaffyAffy13~~

    If I have helped you solve your problem, please be sure to click at the bottom left of my post.

    Thanks.

  5. #5
    Registered User
    Join Date
    07-15-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Help Separating Words in one column to two columns

    Thank you all for the fast replies, I can't believe I didn't think of the text to column option myself but i'll be sure to try out all of these methods to see which one works best.

+ 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. [SOLVED] Separating column into multiple columns using row value
    By Cake_Support in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-06-2013, 05:32 PM
  2. Replies: 3
    Last Post: 05-10-2010, 12:14 PM
  3. Separating one column into multiple columns
    By justmiller in forum Excel General
    Replies: 6
    Last Post: 04-07-2010, 01:51 PM
  4. Replies: 2
    Last Post: 07-17-2008, 01:55 PM
  5. Separating Names in a Column to Two Columns
    By donniebrook in forum Excel General
    Replies: 1
    Last Post: 05-13-2005, 03:06 PM

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