Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default crosstable to column

hello everybody
I have a little problem, I have a table in my excel worksheet,
like this for example:
1 2 3 4
5 6 7 8
where the number of rows and columns can vary.
I would like to transform this table in one column, like this:
1
5
2
6
3
7
4
8
Can anybody help me? Do I need a macro for this?
Thanks a lot
bernie

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default crosstable to column

Maybe something like:

Option Explicit
Sub testme()

Dim iCol As Long
Dim LastCol As Long
Dim DestCell As Range
Dim CurWks As Worksheet
Dim NewWks As Worksheet

Set CurWks = Worksheets("sheet1")
Set NewWks = Worksheets.Add

With CurWks
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
For iCol = 1 To LastCol
With NewWks
Set DestCell = .Cells(.Rows.Count, "A").End(xlUp)
If IsEmpty(DestCell.Value) Then
'do nothing
Else
Set DestCell = DestCell.Offset(1, 0)
End If
End With
.Range(.Cells(1, iCol), .Cells(.Rows.Count, iCol).End(xlUp)).Copy _
Destination:=DestCell
Next iCol
End With

End Sub


bernieb wrote:

hello everybody
I have a little problem, I have a table in my excel worksheet,
like this for example:
1 2 3 4
5 6 7 8
where the number of rows and columns can vary.
I would like to transform this table in one column, like this:
1
5
2
6
3
7
4
8
Can anybody help me? Do I need a macro for this?
Thanks a lot
bernie


--

Dave Peterson
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
divide column(x) by column(y) to give column(x/y) in excel? James New Users to Excel 2 April 24th 23 11:46 AM
Referencing date column A & time column B to get info from column TVGuy29 Excel Discussion (Misc queries) 1 January 24th 08 09:50 PM
Return text in Column A if Column B and Column K match jeannie v Excel Worksheet Functions 4 December 13th 07 07:36 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Discussion (Misc queries) 1 December 27th 06 05:47 PM
Crosstable to list simon_nnn Excel Discussion (Misc queries) 2 August 18th 05 10:05 AM


All times are GMT +1. The time now is 11:48 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"