Results 1 to 4 of 4

Sort Ascending order

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Sort Ascending order

    Hello:

    Please refer to attached sheet.
    I am using the code below to find unique names from list in column A.
    (The code does find Unique names successfully.)
    Once unique name is found, i need to sort out Ascending order.
    For some reason, it is not sorting ascending correctly.
    Please help and modify the code below so that the sorted unique names are pasted in column D.


    Sub employees_Row1()
    'Range("K1").Resize(1, Columns.Count - 10).ClearContents
    Range("D1").Resize(1, Columns.Count - 4).ClearContents
    'Range("AA3").Resize(Rows.Count, 1).ClearContents
    If MsgBox("Do you want to run the macro", vbYesNo) = vbNo Then Exit Sub
    Application.ScreenUpdating = False
    With Range("B2", Cells(Rows.Count, 2).End(xlUp))
        .AdvancedFilter xlFilterInPlace, , , True
        .Offset(1).Copy ' cell C1 is header of column C
        [D2].PasteSpecial xlPasteValues
        '[AA1].PasteSpecial xlPasteAll, xlNone, False, True
        .AutoFilter: .AutoFilter
    End With
    With Selection
        .Sort Key1:=.Cells(1), Order1:=xlAscending, Orientation:=xlLeftToRight
        
    End With
    Application.ScreenUpdating = True
    End Sub
    Please let me know if any questions.

    Thank you

    Riz Momin
    Attached Files Attached Files
    Last edited by rizmomin; 06-16-2013 at 02:27 PM.

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