LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Conditional Sort?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ascending Sort formula, change to neg #: descending sort.. nastech Excel Discussion (Misc queries) 6 July 2nd 07 11:00 PM
sort a cell that was highlighted by conditional formating? brbradle Excel Worksheet Functions 0 May 3rd 06 09:15 PM
Sort by conditional formats? jbtenor1 Excel Worksheet Functions 6 January 5th 06 06:12 PM
Excel sort by Fill Color by custom list sort Dash4Cash Excel Discussion (Misc queries) 2 July 29th 05 10:45 PM
Excel Sort function should not sort the cell formatting! Lisa D.N.1 Excel Worksheet Functions 1 December 28th 04 08:37 PM


All times are GMT +1. The time now is 04:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"