+ Reply to Thread
Results 1 to 3 of 3

Sort Ascending

  1. #1
    Registered User
    Join Date
    06-07-2010
    Location
    california, us
    MS-Off Ver
    Excel 2003
    Posts
    37

    Sort Ascending

    Hello,

    Unfortunate the circumstances, I am not very good with excel
    Currently I have the following code to insert the copied range into the combobox. The following code works fine.

    With Sheet1
    .Range(.Range("D3"), .Range("D" & .Rows.Count).End(xlUp)) _
    .AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Range("P3"), Unique:=True
    fClient.List = .Range(.Cells(4, 16), .Cells(.Rows.Count, 16).End(xlUp)).Value
    End With

    However, when following is entered (added), the code does not work... what I am trying to do is to "sort ascending" the range so that it would display alphabetical order in the combobox shown. The name of the worksheet is BalanceSheet

    With Sheet1
    .Range(.Range("D3"), .Range("D" & .Rows.Count).End(xlUp)) _
    .AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Range("P3"), Unique:=True
    fClient.List = .Range(.Cells(4, 16), .Cells(.Rows.Count, 16).End(xlUp)).Value
    Sheet1.Range(“P3″, Sheet1.Range(“P65536″).End(xlUp)).Sort _
    Key1:=Range(“P3″), Order1:=xlAscending, Header:=xlGuess, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    DataOption1:=xlSortNormal
    End With
    If you require any further information, please let me know and I will upload what information is required.
    Your assistance is much appreciated. Thanks so much in advanced.
    Last edited by jhc8255; 04-21-2011 at 04:06 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Sort Ascending

    I have modified the macro little

    the old code statement which are replaced in one tab
    the comments are in capitals in two tabs

    i am sending the code in .doc format ant attached "excelforum.doc"

    any comments post back. If it is with respect to the code give the code statements where there is problem and also error message if any
    .
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Sort Ascending

    smally typing mistake

    change the comments in capitals below with sheet

    'PUT SOME HEADING IN D3.IF YOU PUT HEADING IN D2 THEN YOUR ADVANCE FILTER RANGE SHOULD BE FROM RANGE D2 AND NOT D3

+ Reply to Thread

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