+ Reply to Thread
Results 1 to 2 of 2

Seperate Values in single cell seperated by [alt+enter] into seperate cells

Hybrid View

  1. #1
    Registered User
    Join Date
    10-22-2012
    Location
    Washington, D.C.
    MS-Off Ver
    Excel 2007
    Posts
    1

    Seperate Values in single cell seperated by [alt+enter] into seperate cells

    Hello all,

    I am trying to seperate values in a single cell (delimiter=[alt+enter] into seperate roles. Along with this, when a new row is created, the cell to the left represents the group where the value cam from. Below is an easier to understand:

    Column A=Sky (A1)
    Values= clouds [alt+enter] (B1)
    birds [alt+enter] (B1)
    Planes (B1)
    -------------------------------------------------------
    and instead I want it to look like:
    Column A Column B
    Sky Clouds
    Sky Birds
    Sky Planes



    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Seperate Values in single cell seperated by [alt+enter] into seperate cells

    Try it once.

    Sub hsv()
    Dim rw As Long, sq As Variant
     For rw = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
       sq = Split(Cells(rw, 2), Chr(10))
         Cells(rw, 1).Offset(1).Resize(UBound(sq)).EntireRow.Insert
         Cells(rw, 1).Offset(1).Resize(UBound(sq)) = Cells(rw, 1)
         Cells(rw, 2).Resize(UBound(sq) + 1) = Application.Transpose(sq)
      Next rw
    End Sub
    Harry.

+ 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