Try in a macro enabled workbook (.xls or .xlsm)

Sub CustomSortSAS() 'converts to values
Rows(3).Clear
x = Application.Match(Application.Min(Rows(2)), Rows(2))
y = Application.Match(Application.Max(Rows(2)), Rows(2))

Cells(3, y - x + 2).Resize(, x - 1).Value = _
Cells(2, 1).Resize(, x - 1).Value

Cells(3, 1).Resize(, y - x + 1).Value = _
Cells(2, x).Resize(, y - x + 1).Value

Cells(3, 1).Resize(, y - x + 1).Sort Key1:=Cells(3, 1), Order1:=xlDescending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight
End Sub
‘or
Sub CustomSortSAS1() 'copies
x = Application.Match(Application.Min(Rows(2)), Rows(2))
y = Application.Match(Application.Max(Rows(2)), Rows(2))
Cells(2, 1).Resize(, x - 1).Copy Cells(3, y - x + 2)
Cells(2, x).Resize(, y - x + 1).Copy Cells(3, 1)
Cells(3, 1).Resize(, y - x + 1).Sort Key1:=Cells(3, 1), Order1:=xlDescending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight
End Sub

From: shivashankar katageri 
Sent: Friday, September 23, 2011 1:21 AM
To: excel-macros@googlegroups.com 
Subject: $$Excel-Macros$$ columns data need to be in reverse order

Dear all,

Any body help in this matter,please have luk of the attachement,

I have lot of columns data,Now I want all the data with formula in reverse 
manner

-- 

Thanks & Regards

Shivashankar.C.Katageri

9945800300



-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com
 
<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to