Sort Macro

  • Thread starter Thread starter caradomski
  • Start date Start date
C

caradomski

I would like to build a sort macro that allows a user to click on the
column header(like a hyperlink) and have the excel spread sheet update
to that sort. Instead of the user going up and using the tool sort
function. Similar to how microsoft outlook would update the sort when
you click on date. In the excel case I would really be clicking on
cell A1 or A2, etc.
 
right click sheet tab>view code>insert this>SAVE

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
[SortRange].Sort Key1:=Cells(1, activecell.column), _
Order1:=xlAscending,Orientation:=xlTopToBottom
End Sub
 
Back
Top