+ Reply to Thread
Results 1 to 3 of 3

Move Information Down a column

Hybrid View

Rabastan Move Information Down a column 07-07-2014, 11:17 PM
millz Re: Move Information Down a... 07-07-2014, 11:35 PM
Rabastan Re: Move Information Down a... 07-08-2014, 12:34 AM
  1. #1
    Registered User
    Join Date
    07-07-2014
    Location
    Columbus, Ohio
    MS-Off Ver
    2010
    Posts
    2

    Move Information Down a column

    I Have a table in Excel that current look like this
    Name 1 Item 1, Item 2, Item 3
    Name 2 Item 1, Item 2

    With 650+ Rows. What I need it for it to look like this
    NAme 1 Item 1
    Name 1 Item 2
    Name 1 Item 3
    Name 2 Item 1
    Name 2 Item 2
    There are about 20 Items that could be assigned to a name, They are fixed.

    Is there a way to create a macro or series of macros the car make this change, as doing it by hand is going to take way too long.

    Thanks in advance
    Rab

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

    Re: Move Information Down a column

    I assume your data starts at A1 and you have a header row, if not create a header row.

    Try running this:
    Sub SplitRows()
        Dim a, b, i As Long, j As Long
        With Range("A1").CurrentRegion
            a = .Value
            .Offset(1).Value = ""
            For i = 2 To UBound(a, 1)
                If InStr(a(i, 2), ",") > 0 Then
                    b = Split(a(i, 2), ",")
                    For j = 0 To UBound(b)
                        Range("A" & rows.Count).End(xlUp).Offset(1).Resize(, 2).Value = Array(a(i, 1), Trim(b(j)))
                    Next
                Else
                    Range("A" & rows.Count).End(xlUp).Offset(1).Resize(, 2).Value = Array(a(i, 1), a(i, 2))
                End If
            Next
        End With
    End Sub
    Last edited by millz; 07-07-2014 at 11:40 PM. Reason: Amendment
    多么想要告诉你 我好喜欢你

  3. #3
    Registered User
    Join Date
    07-07-2014
    Location
    Columbus, Ohio
    MS-Off Ver
    2010
    Posts
    2

    Re: Move Information Down a column

    That Worked Awesome, Ty SO Much!! This will save me so much time.

    Rab

+ 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] Macro with Formula to move specific information to new column
    By redzan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-31-2014, 03:29 PM
  2. Replies: 7
    Last Post: 03-20-2014, 10:10 AM
  3. Pulling Information from a column Based on Information in a Second Column
    By jennyaccord in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2014, 08:21 PM
  4. Formula to move certain information in a column to a table that meets criteria?
    By MikeTruth in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-28-2012, 04:53 AM
  5. Move information over
    By AzzuGrant in forum Excel General
    Replies: 5
    Last Post: 12-21-2010, 12:22 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