Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jezzica85
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.misc
Ken Wright
 
Posts: n/a
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I sort the data in 8 columns by two of the columns? Sorting Excel Worksheet Functions 1 October 25th 05 03:57 PM
How to swap rows and columns? [email protected] Excel Discussion (Misc queries) 5 September 21st 05 08:07 AM
Hiding columns and custom views problem Bettergains Excel Discussion (Misc queries) 2 April 12th 05 11:48 PM
Removing Near-Duplicate Rows, Leaving Those w/Most Data in Specific Columns foofoo Excel Discussion (Misc queries) 1 April 2nd 05 12:02 AM
Counting the Contents of Two Columns Molochi Excel Discussion (Misc queries) 6 December 22nd 04 08:13 PM


All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"