Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 82
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 219
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 618
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default 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
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
macro unouwanme Excel Discussion (Misc queries) 9 August 31st 06 09:38 PM
Stock data manipulation [email protected] Excel Worksheet Functions 1 June 12th 06 11:06 PM
Column picked randomly with probability relative to number of entr Neil Goldwasser Excel Worksheet Functions 4 May 30th 06 08:55 AM
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM


All times are GMT +1. The time now is 08:14 PM.

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"