Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
to reverse a column
I have a column of data.
I want to reverse it. Is it possible? as ab ad change to ad ab as |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
to reverse a column
Make a "helper" column with 1,2,3... and then sort descending on that.
"Rasoul Khoshravan" wrote: I have a column of data. I want to reverse it. Is it possible? as ab ad change to ad ab as |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
to reverse a column
'/=================================================/
Sub FlipIt() 'reverse order of a selection ' 1st cell is last and last is first, ett ' Dim aryCollection() Dim LngCount As Long Dim lngCellCount As Long Dim rng As Range Set rng = Application.InputBox(Prompt:="Select Range to be Searched: ", _ Title:="Range Selection...", _ Default:=Application.Selection.Address, Type:=8) If Len(rng.Address) = 0 Then MsgBox "No Cells were selected." & vbLf & vbLf & _ "Process Aborted.....", vbExclamation + vbOKOnly, "WARNING....." Exit Sub End If rng.Select 'check for multiple range selections If Selection.Areas.Count 1 Then MsgBox "Multiple Range selections are not supported.", _ vbExclamation + vbOKOnly, "Warning..." End If If Selection.Cells.Count = 1 Then MsgBox "You have not selected a range of cells.", _ vbExclamation + vbOKOnly, "Warning..." Exit Sub End If lngCellCount = Selection.Cells.Count 'redim array ReDim aryCollection(1 To lngCellCount) 'populate array For LngCount = 1 To lngCellCount aryCollection(LngCount) = Selection.Cells(LngCount).value Next LngCount 'reverse order of cells For LngCount = lngCellCount To 1 Step -1 Selection.Cells(lngCellCount - LngCount + 1).value = _ aryCollection(LngCount) Next LngCount End Sub '/=================================================/ HTH, -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "Rasoul Khoshravan" wrote: I have a column of data. I want to reverse it. Is it possible? as ab ad change to ad ab as |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
to reverse a column
The easiest way is probably to add a helper column alongside with numbers
from 1 to N. Select the two columns, & sort by your second column in descending order, then you can delete your helper column. -- David Biddulph "Rasoul Khoshravan" wrote in message ... I have a column of data. I want to reverse it. Is it possible? as ab ad change to ad ab as |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
to reverse a column
In an adjacent column enter the numbers 1 to whatever.
Select both columns and sort on that column in descending order. Gord Dibben MS Excel MVP On Fri, 20 Oct 2006 00:22:49 +0900, "Rasoul Khoshravan" wrote: I have a column of data. I want to reverse it. Is it possible? as ab ad change to ad ab as |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro | Excel Discussion (Misc queries) | |||
Stock data manipulation | Excel Worksheet Functions | |||
Column picked randomly with probability relative to number of entr | Excel Worksheet Functions | |||
Return SEARCHED Column Number of Numeric Label and Value | Excel Worksheet Functions | |||
creating a bar graph | Excel Discussion (Misc queries) |