Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much. This works well.
"Jim Thomlinson" wrote: You could try something like this. This code is placed in the sheet and not in a module where recorded macro's are. Right click the sheet tab in Excel and select View Code. Paste the following: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Intersect(Target, Range("B1:E1")) Is Nothing Then Range("A1:E100").Sort Key1:=Target, Order1:=xlAscending, Header:=xlYes End If End Sub When a cell B1:E1 is selected it sorts the range A1:E100 -- HTH... Jim Thomlinson "Dave" wrote: I'd like to call a macro that sorts a list simply by clicking on a header cell. Sort Key1 = the cell that the user clicks on. Can one call a macro by clicking on a cell or the contents of a cell? If so, how? Thanks very much. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
using cell contents to link to other tabs | Excel Worksheet Functions | |||
Link format along with contents of another cell | Excel Worksheet Functions | |||
Macro to clear range contents when cell contents are changed by us | Excel Programming | |||
All of contents in cell don't link | Excel Discussion (Misc queries) | |||
Cell only shows link in text, not contents of reference cell | New Users to Excel |