Hi Ashish, Thanks for your help.
Is there any way I can make it cell specific, assign this macro to particular cell. For example, separate macro for cell A1, B1, C1, D1 etc. I want to put two arrows, up & down (one for Ascending sort and second for Descending sort), in each cell. Regards, Sandip On Tue, Jan 25, 2011 at 11:41 PM, ashish koul <koul.ash...@gmail.com> wrote: > Sub sort_ascending() > Dim Temp As String > Temp = ActiveCell.Address > x = Mid(Temp, 2, (InStr(2, Temp, "$") - 2)) > If ActiveCell.Column <= 6 Then > Sheets(1).Range("a1:f" & Range("a1").End(xlDown).Row).Sort > key1:=Sheets(1).Range(x & "1"), order1:=xlAscending, Header:=xlYes > > > End If > End Sub > > Sub sort_des() > Dim Temp As String > Temp = ActiveCell.Address > x = Mid(Temp, 2, (InStr(2, Temp, "$") - 2)) > If ActiveCell.Column <= 6 Then > Sheets(1).Range("a1:f" & Range("a1").End(xlDown).Row).Sort > key1:=Sheets(1).Range(x & "1"), order1:=xlDescending, Header:=xlYes > > > End If > End Sub > > > > > On Wed, Jan 26, 2011 at 7:52 AM, San Pat <myitems2...@gmail.com> wrote: > >> Hi All, >> >> I am working on a excel with data in many columns. >> >> I want to add two macro button on each heading to sort data, one for >> Ascending sort +and second for Descending sort. >> >> Is it possible with macro. >> >> I have attached the sample sheet. >> >> Please advice if it possible. >> >> Regards, >> San >> >> -- >> >> ---------------------------------------------------------------------------------- >> 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 >> > > > > -- > *Regards* > * * > *Ashish Koul* > *akoul*.*blogspot*.com <http://akoul.blogspot.com/> > *akoul*.wordpress.com <http://akoul.wordpress.com/> > My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830> > > > P Before printing, think about the environment. > > > -- > > ---------------------------------------------------------------------------------- > 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