Results 1 to 6 of 6

Modify ranking code

Threaded View

  1. #1
    Registered User
    Join Date
    10-06-2009
    Location
    Diemen, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    87

    Talking Modify ranking code

    Good day friends,

    I'm using this code to select the 10 lowest values and give them a ranking from 1 to 10.

    My query;

    Is it possible to modify this code so that it will give the lowest values the opposite ranking from which it is now. (Please take a look at the example sheet).

    Thank you for any help offered,


    Robert




    Sub TST()
        
        Dim A As Integer, B As Integer
        For A = 1 To 15
            For B = 1 To 10
                If Range("B1").Cells(A, 1) = Application.WorksheetFunction.Small(Range("B1:B15"), B) Then
                    With Range("B1")
                        .Offset(A - 1, 1) = B
                    End With
                    Exit For
                End If
            Next B
        Next A
        
    End Sub
    Last edited by roberto1111; 01-31-2010 at 07:26 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1