If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#21
|
|||
|
|||
Highlighting the 5 Largest Numbers in a list
All!
My sincere thanks to you who contributed to this exercise! I am using the code and it seems robust and works well for my purpose! Cheers! Manosh |
#22
|
|||
|
|||
Highlighting the 5 Largest Numbers in a list
Which code?
-- Don Guillett SalesAid Software wrote in message ups.com... All! My sincere thanks to you who contributed to this exercise! I am using the code and it seems robust and works well for my purpose! Cheers! Manosh |
#23
|
|||
|
|||
Highlighting the 5 Largest Numbers in a list
Manosh, It is good to see that the code works for you, and thank you for your response -- Wrote: All! My sincere thanks to you who contributed to this exercise! I am using the code and it seems robust and works well for my purpose! Cheers! Manosh -- Bryan Hessey ------------------------------------------------------------------------ Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059 View this thread: http://www.excelforum.com/showthread...hreadid=533133 |
#25
|
|||
|
|||
Highlighting the 5 Largest Numbers in a list
Change my code to. See below for an easy way to make automatic
Sub HiglightLargestFiveUnique() 'with helper columnn Cells(1, "l").Value = Application.Max(Range("e2:e72")) For i = 2 To 5 Cells(i, "l").FormulaArray = _ "=max(if(e2:e72l" & i - 1 & ",e2:e72))" Next i Columns(5).Interior.ColorIndex = 0 On Error Resume Next ci = 37 For Each cel In Range("l1:l5") With Range("e2:e" & Cells(Rows.Count, "e").End(xlUp).Row) 'rng Set c = .Find(cel, _ LookIn:=xlValues, lookat:=xlWhole) If Not c Is Nothing Then firstAddress = c.Address Do c.Interior.ColorIndex = ci Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address firstAddress End If End With ci = ci + 1 Next cel End Sub To autorun the macro on a change in col E (5) Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 5 Then HiglightLargestFiveUnique End Sub -- Don Guillett SalesAid Software "Don Guillett" wrote in message ... I create a helper column and use that in the findnext It works but could probably be better. Assumes data in col E and helper col in col L (could be hidden) Sub HiglightLargestFiveUnique() 'with helper column Cells(1, "l").Value = Application.Max(Range("e2:e500")) For i = 2 To 5 Cells(i, "l").FormulaArray = _ "=max(if(e2:e500l" & i - 1 & ",e2:e500))" Next i Columns(5).Interior.ColorIndex = 0 On Error Resume Next ci = 33 For Each cel In Range("l1:l5") With Range("e2:e" & Cells(Rows.Count, "e").End(xlUp).Row) Set c = .Find(cel, _ LookIn:=xlValues, lookat:=xlWhole) If Not c Is Nothing Then firstAddress = c.Address Do c.Interior.ColorIndex = ci Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address firstAddress End If End With ci = ci + 1 Next cel End Sub -- Don Guillett SalesAid Software wrote in message oups.com... Hi all, I have a Score column that runs into many entries. Is there a way to highlight the top 5 scores on the list in different colours. Conditional format permits me to highlight the three largest only (yes another gripe on this much needed excel feature!) Any help is appreciated in advance!! Regards Manosh |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Conditional format from a list of numbers | langba | General Discussion | 3 | April 7th, 2006 11:02 AM |
find sum in list of of numbers | Jim Thomlinson | New Users | 5 | January 4th, 2006 07:07 PM |
Creating a list of sequential numbers | eb1mom | Database Design | 2 | September 22nd, 2004 10:37 PM |
adding values from another worksheet by matching criteria | Frank Kabel | Worksheet Functions | 2 | March 16th, 2004 03:15 PM |
Create a randomly sorted list from selected numbers | Twofingers | Worksheet Functions | 6 | December 31st, 2003 11:49 PM |