ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Transpose from last to first (https://www.excelbanter.com/excel-discussion-misc-queries/183104-transpose-last-first.html)

Angela

Transpose from last to first
 
I need some help!!!
Im trying to copy and paste from a column to a row but I want to paste the
information from last to first. How do I do that...:
This is an example of what I need:

From:
1
2
3
4
To :
4 3 2 1
Thank you

Mike

Transpose from last to first
 
Sub lasttofirst()
'test with column A

Dim rngA As Range
Dim i As Long
Dim nextColum As Integer

Set rngA = ActiveSheet.Range(Cells(1, "A"), _
Cells(Rows.Count, "A").End(xlUp))
'Work backwards from bottom to top
nextColum = 2
With rngA
For i = .Rows.Count To 1 Step -1
Cells(2, nextColum).Value = .Cells(i)
nextColum = nextColum + 1
Next i
End With
End Sub

"Angela" wrote:

I need some help!!!
Im trying to copy and paste from a column to a row but I want to paste the
information from last to first. How do I do that...:
This is an example of what I need:

From:
1
2
3
4
To :
4 3 2 1
Thank you


BoniM

Transpose from last to first
 
Change the sort order from ascending to descending and then copy and
paste/transpose as usual. If your actual data does not have a column you can
sort with, you can add a helper column of incremented numbers to accomplish
the task.


"Angela" wrote:

I need some help!!!
Im trying to copy and paste from a column to a row but I want to paste the
information from last to first. How do I do that...:
This is an example of what I need:

From:
1
2
3
4
To :
4 3 2 1
Thank you


Mike H

Transpose from last to first
 
Angela,

Do it in 2 stages.
First select the data copy it and then select your start cell and
Edit |Paste special|transpose
Select the transposed data and then
data|Sort|Options select left to right and do your sort
Mike

"Angela" wrote:

I need some help!!!
Im trying to copy and paste from a column to a row but I want to paste the
information from last to first. How do I do that...:
This is an example of what I need:

From:
1
2
3
4
To :
4 3 2 1
Thank you


Ron Rosenfeld

Transpose from last to first
 
On Wed, 9 Apr 2008 11:45:01 -0700, Angela
wrote:

I need some help!!!
Im trying to copy and paste from a column to a row but I want to paste the
information from last to first. How do I do that...:
This is an example of what I need:

From:
1
2
3
4
To :
4 3 2 1
Thank you


You could do it with a formula, so sorting would not be required.

NAME your column of data "rng".

Then enter this formula in some cell, and fill right as far as required:

=IF(COLUMNS($A:A)ROWS(rng),"",INDEX(rng,ROWS(rng) +1-COLUMNS($A:A)))

--ron

Gord Dibben

Transpose from last to first
 
Copy and paste specialtranspose then sort left to right on the row.


Gord Dibben MS Excel MVP

On Wed, 9 Apr 2008 11:45:01 -0700, Angela
wrote:

I need some help!!!
Im trying to copy and paste from a column to a row but I want to paste the
information from last to first. How do I do that...:
This is an example of what I need:

From:
1
2
3
4
To :
4 3 2 1
Thank you




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com