+ Reply to Thread
Results 1 to 3 of 3

Putting many columns into one

  1. #1
    jezzica85
    Guest

    Putting many columns into one

    Hi all,
    Yet another Excel question from me, but I know I can turn here, everybody's
    always so helpful, thanks again! My question this time is, is there an easy
    way to consolidate colums without having to cut and paste them all together.
    Basically, is there a quick way to turn:

    a b c d
    a b c d
    a b c d
    a b c d

    into:
    a
    a
    a
    a
    b
    b
    b
    b
    c
    c
    c
    c
    d
    d
    d
    d

    Thanks a million!

  2. #2
    Bob Phillips
    Guest

    Re: Putting many columns into one

    Some VBA

    Sub Test()
    Dim iLastRow As Long
    Dim iLastCol As Long
    Dim i As Long, j As Long

    iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
    For i = iLastRow To 1 Step -1
    iLastCol = Cells(i, Columns.Count).End(xlToLeft).Column
    If iLastCol > 1 Then
    Rows(i + 1).Resize(iLastCol - 1).Insert
    For j = 2 To iLastCol
    Cells(i + j - 1, "A").Value = Cells(i, j).Value
    Next j
    Cells(i, 2).Resize(, iLastCol - 1).Clear
    End If
    Next i

    End Sub


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "jezzica85" <[email protected]> wrote in message
    news:[email protected]...
    > Hi all,
    > Yet another Excel question from me, but I know I can turn here,

    everybody's
    > always so helpful, thanks again! My question this time is, is there an

    easy
    > way to consolidate colums without having to cut and paste them all

    together.
    > Basically, is there a quick way to turn:
    >
    > a b c d
    > a b c d
    > a b c d
    > a b c d
    >
    > into:
    > a
    > a
    > a
    > a
    > b
    > b
    > b
    > b
    > c
    > c
    > c
    > c
    > d
    > d
    > d
    > d
    >
    > Thanks a million!




  3. #3
    Ken Wright
    Guest

    Re: Putting many columns into one

    Assuming your data is in A1:D100, then in say H5 (Row is important - column
    is not) put the following and copy down to H505

    =OFFSET($A$1,FLOOR((ROW()-5)/4,1),MOD(ROW()-5,4))

    --
    Regards
    Ken....................... Microsoft MVP - Excel
    Sys Spec - Win XP Pro / XL 97/00/02/03

    ------------------------------*------------------------------*----------------
    It's easier to beg forgiveness than ask permission :-)
    ------------------------------*------------------------------*----------------


    "jezzica85" <[email protected]> wrote in message
    news:[email protected]...
    > Hi all,
    > Yet another Excel question from me, but I know I can turn here,
    > everybody's
    > always so helpful, thanks again! My question this time is, is there an
    > easy
    > way to consolidate colums without having to cut and paste them all
    > together.
    > Basically, is there a quick way to turn:
    >
    > a b c d
    > a b c d
    > a b c d
    > a b c d
    >
    > into:
    > a
    > a
    > a
    > a
    > b
    > b
    > b
    > b
    > c
    > c
    > c
    > c
    > d
    > d
    > d
    > d
    >
    > Thanks a million!




+ 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