Results 1 to 2 of 2

Excel 2007 : sort smallest number to largest

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-13-2008
    Location
    wales (uk)
    Posts
    113

    sort smallest number to largest

    hello peeps

    I have a code on one of my sheets which automatically sorts all the cells after user input. can someone tell me how to modd it so it sorts the number from smallest to largest? at the mo I have number such as 10, 15 20, 215, 60, etc etc it is ordering 215 before 60 because of the first digit.

    here is the code

    Private Sub Worksheet_Change(ByVal Target As Range)
        Columns(Target.Column).Sort _
            Key1:=Cells(1, Target.Column), _
            Order1:=xlAscending, _
            Header:=xlNo, _
            OrderCustom:=1, _
            MatchCase:=False, _
            Orientation:=xlTopToBottom
    End Sub

    Any help would be most appreciated.

    Raj
    Last edited by NBVC; 12-06-2011 at 11:19 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