ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please Help with Excel Sorting Macro!! (https://www.excelbanter.com/excel-programming/278852-please-help-excel-sorting-macro.html)

ticketopia

Please Help with Excel Sorting Macro!!
 
Help!!! I need a macro that will sort data by a column when the user
clicks on the column heading (i.e., username).

The macro then needs to return the user to the cell that was selected
prior to sorting the data.

Oh yeah, and I need it within a 1/2 hour.......

Puhleeeeeeaase help me!!!!!

Thanks so much!!



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Don Guillett[_4_]

Please Help with Excel Sorting Macro!!
 
Right click on the sheet tabview codeinsert thissave workbook.
name your range to be sorted as sortrange
Double click on any column to sort by that column.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel
As Boolean)
[sortrange].Sort Key1:=Cells(1, activecell.column), Order1:=xlAscending,
Orientation:=xlTopToBottom
SendKeys "^{home}"
End Sub



"ticketopia" wrote in message
...
Help!!! I need a macro that will sort data by a column when the user
clicks on the column heading (i.e., username).

The macro then needs to return the user to the cell that was selected
prior to sorting the data.

Oh yeah, and I need it within a 1/2 hour.......

Puhleeeeeeaase help me!!!!!

Thanks so much!!



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com