Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Eric,
If I correct the ranges in my code to: Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Intersect(Target, Me.Range("D2:D8")) Is Nothing Then Exit Sub Application.EnableEvents = False Range("A2:D8").Sort Key1:=Range("D3"), Order1:=xlDescending, _ Header:=xlNo, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom Application.EnableEvents = True End Sub It works for me as you wanted. The only thing that I can think of is: you should have pasted the code into a sheet module - not a normal module. If you still can't get the code to run automatically then feel free to send me a sample sheet by altering my address below as it says in my signature. -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings Replace @mailinator.com with @tiscali.co.uk "Eric" wrote in message ... Helllo, I can't seem to get either of these to work right. Stephane I did fix the line wrapping in your code. Also, Sandy I am have no luck. I did make sure to save the document as a macro-enabled workbook. The values are percents and I want the highest % at the top of the range. I did edit the Range in both to C2:C8 as that is the actual range. I changed the single cell from D3 to C2 as well. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Ascending Sort formula, change to neg #: descending sort.. | Excel Discussion (Misc queries) | |||
sort a cell that was highlighted by conditional formating? | Excel Worksheet Functions | |||
Sort by conditional formats? | Excel Worksheet Functions | |||
Excel sort by Fill Color by custom list sort | Excel Discussion (Misc queries) | |||
Excel Sort function should not sort the cell formatting! | Excel Worksheet Functions |