Results 1 to 3 of 3

Sorting Columns in Ascending Order

Threaded View

COLIN_303 Sorting Columns in Ascending... 04-17-2013, 05:51 AM
martindwilson Re: Sorting Columns in... 04-17-2013, 06:22 AM
COLIN_303 Re: Sorting Columns in... 04-17-2013, 07:51 AM
  1. #1
    Registered User
    Join Date
    07-14-2011
    Location
    plymouth
    MS-Off Ver
    Excel 2003
    Posts
    26

    Sorting Columns in Ascending Order

    Hi All

    Iam have trouble sorting one of my Columns (Column C) into Ascending Order, the column contains Numbers & Text eg 13A

    the way it is currently sorted is:

    13A
    1B
    2A

    Where as I want it to be Sorted by Number then by Text eg:

    1B
    2A
    13A

    Attached is a copy of the workbook and the macro that i have been using, any help will be much appreciated

    Kind Regards
    Colin

    ActiveSheet.Range("$A$1:$F$" & ActiveSheet.Cells(1, 1).End(xlDown).Row).Select
         
         
         With ActiveWorkbook.Worksheets("Sheet1").Sort
            .SortFields.Clear
            .SortFields.Add Key:=Cells(2, 1), _
                    SortOn:=xlSortOnValues, _
                    Order:=xlAscending, _
                    DataOption:=xlSortNormal
            .SortFields.Add Key:=Cells(2, 2), _
                    SortOn:=xlSortOnValues, _
                    Order:=xlAscending, _
                    DataOption:=xlSortNormal
            .SortFields.Add Key:=Cells(2, 3), _
                    SortOn:=xlSortOnValues, _
                    Order:=xlAscending, _
                    DataOption:=xlSortNormal
            .SortFields.Add Key:=Cells(2, 4), _
                    SortOn:=xlSortOnValues, _
                    Order:=xlAscending, _
                    DataOption:=xlSortNormal
                    
            .SetRange Range("$A$1:$F$" & ActiveSheet.Cells(2, 1).End(xlDown).Row)
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    Attached Files Attached Files

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