#1   Report Post  
Biman
 
Posts: n/a
Default Transpose Problem

Hi,

I have multiple rows of data spanning across 10 columns. This has to be
transposed onto ONE column where each row of data has to be APPENED one below
the other.
For eg: if the data is available from C1 to L4, this data has to be
transposed onto the column B from B1 to B40.

Is there any simpler way than doing it manually one by one. Please help

-Biman.
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

Try this macro

Sub OneColumn()

''''''''''''''''''''''''''''''''''''''''''
'Macro to tranpose rows '
'into 1 continuous column in a new sheet '
''''''''''''''''''''''''''''''''''''''''''

'Constructive criticism from knowledgable
'VBA programmers welcome - esp. BP!

Dim OrigDataLastRow As Long
Dim AllDataLastRow As Long
Dim RowNdx As Long
Dim ws As Worksheet
Dim CopyRow As Range

Set ws = ActiveWorkbook.ActiveSheet
OrigDataLastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
AllDataLastRow = 1

Sheets.Add.Name = "Alldata"

With Application
.ScreenUpdating = False

For RowNdx = 1 To OrigDataLastRow
Set CopyRow = ws.Range(RowNdx & ":" & RowNdx)
CopyRow.Copy
Sheets("Alldata").Cells(AllDataLastRow, 1). _
PasteSpecial Transpose:=True
AllDataLastRow = Sheets("Alldata"). _
Cells(Rows.Count, 1).End(xlUp).Row + 1
Next

.ScreenUpdating = True
.CutCopyMode = False

End With

End Sub

---
HTH
Jason
Atlanta, GA

-----Original Message-----
Hi,

I have multiple rows of data spanning across 10 columns.

This has to be
transposed onto ONE column where each row of data has to

be APPENED one below
the other.
For eg: if the data is available from C1 to L4, this

data has to be
transposed onto the column B from B1 to B40.

Is there any simpler way than doing it manually one by

one. Please help

-Biman.
.

  #3   Report Post  
Alan Beban
 
Posts: n/a
Default

Biman wrote:
Hi,

I have multiple rows of data spanning across 10 columns. This has to be
transposed onto ONE column where each row of data has to be APPENED one below
the other.
For eg: if the data is available from C1 to L4, this data has to be
transposed onto the column B from B1 to B40.

Is there any simpler way than doing it manually one by one. Please help

-Biman.

What goes in B2, the value from C2 or D1? If the functions in the freely
downloadable file at http://home.pacbell.net/beban are available to your
workbook then

=ArrayReshape(C1:L4,40,1) if the answer above is D1;
=ArrayReshape(C1:L4,40,1,FALSE) if the answer above is C2.

Alan Beban
  #4   Report Post  
Herbert Seidenberg
 
Posts: n/a
Default

Here is another way without VBA
1. Edit | Office Clipboard | Clear All
2. Select C1:C4 | Copy
3. Repeat step 2 for each additional column
4. Select B1
5. Office Clipboard | Paste All

  #5   Report Post  
Biman
 
Posts: n/a
Default

Thanks Jason. It works perfectly.

-Biman

"Jason Morin" wrote:

Try this macro

Sub OneColumn()

''''''''''''''''''''''''''''''''''''''''''
'Macro to tranpose rows '
'into 1 continuous column in a new sheet '
''''''''''''''''''''''''''''''''''''''''''

'Constructive criticism from knowledgable
'VBA programmers welcome - esp. BP!

Dim OrigDataLastRow As Long
Dim AllDataLastRow As Long
Dim RowNdx As Long
Dim ws As Worksheet
Dim CopyRow As Range

Set ws = ActiveWorkbook.ActiveSheet
OrigDataLastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
AllDataLastRow = 1

Sheets.Add.Name = "Alldata"

With Application
.ScreenUpdating = False

For RowNdx = 1 To OrigDataLastRow
Set CopyRow = ws.Range(RowNdx & ":" & RowNdx)
CopyRow.Copy
Sheets("Alldata").Cells(AllDataLastRow, 1). _
PasteSpecial Transpose:=True
AllDataLastRow = Sheets("Alldata"). _
Cells(Rows.Count, 1).End(xlUp).Row + 1
Next

.ScreenUpdating = True
.CutCopyMode = False

End With

End Sub

---
HTH
Jason
Atlanta, GA

-----Original Message-----
Hi,

I have multiple rows of data spanning across 10 columns.

This has to be
transposed onto ONE column where each row of data has to

be APPENED one below
the other.
For eg: if the data is available from C1 to L4, this

data has to be
transposed onto the column B from B1 to B40.

Is there any simpler way than doing it manually one by

one. Please help

-Biman.
.




  #6   Report Post  
Biman
 
Posts: n/a
Default

Thanks Alan.

"Alan Beban" wrote:

Biman wrote:
Hi,

I have multiple rows of data spanning across 10 columns. This has to be
transposed onto ONE column where each row of data has to be APPENED one below
the other.
For eg: if the data is available from C1 to L4, this data has to be
transposed onto the column B from B1 to B40.

Is there any simpler way than doing it manually one by one. Please help

-Biman.

What goes in B2, the value from C2 or D1? If the functions in the freely
downloadable file at http://home.pacbell.net/beban are available to your
workbook then

=ArrayReshape(C1:L4,40,1) if the answer above is D1;
=ArrayReshape(C1:L4,40,1,FALSE) if the answer above is C2.

Alan Beban

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
repeated transpose from rows to columns with unequal groups kraymond Excel Discussion (Misc queries) 3 December 20th 04 02:39 PM
Problem with date base units for x axis Peter Carr Charts and Charting in Excel 1 December 15th 04 09:11 AM
Hyperlink to word document problem JS Links and Linking in Excel 0 December 8th 04 10:54 PM
Paper Tray selection Problem, Michael Hoffmann Excel Discussion (Misc queries) 4 December 3rd 04 09:08 PM
File is locked for Editing by user problem Mirth Excel Discussion (Misc queries) 1 December 3rd 04 04:45 PM


All times are GMT +1. The time now is 10:56 AM.

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

About Us

"It's about Microsoft Excel"