Transpose from last to first

A

Angela

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
 
M

Mike

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
 
B

BoniM

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.
 
M

Mike H

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
 
R

Ron Rosenfeld

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
 
G

Gord Dibben

Copy and paste special>transpose then sort left to right on the row.


Gord Dibben MS Excel MVP
 
Top