Results 1 to 2 of 2

Optimize Alphabetizing VBA Code

Threaded View

NewExcelUser Optimize Alphabetizing VBA... 08-29-2010, 08:42 PM
shg Re: Optimize Alphabetizing... 08-29-2010, 11:51 PM
  1. #1
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151

    Optimize Alphabetizing VBA Code

    Good day,

    Is there a more condensed, more efficient way to execute the alphabetizing a column in Excel? This is what I got from the VBA Recorder.

    Sheets(2).Select
    Sheets(2).Range("F2:F231").Select
        ActiveWorkbook.Worksheets("Sort & Label").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Sort & Label").Sort.SortFields.Add Key:=Range("F2" _
            ), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Sort & Label").Sort
            .SetRange Range("F2:G231")
            .Header = xlNo
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    Thank you for your time and assistance
    Last edited by NewExcelUser; 08-29-2010 at 08:56 PM. Reason: Adjust Title

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