+ Reply to Thread
Results 1 to 4 of 4

xlascending

Hybrid View

excel_lover xlascending 09-14-2008, 07:02 AM
Andy Pope The the use of 2 different... 09-14-2008, 07:06 AM
excel_lover Thanks Andy Easy to... 09-14-2008, 07:11 AM
martindwilson i see you are applying this... 09-14-2008, 07:45 AM
  1. #1
    Registered User
    Join Date
    08-30-2008
    Location
    London
    Posts
    35

    xlascending

    Hi All,

    I have a problem with getting my code to sort ascending.
    Here is the code i have used -

    Private Sub CommandButton1_Click()
        Worksheets("Postcode Model").Range("A12:K1000").sort _
        Key1:=Worksheets("PostcodeModel").Columns("H"), Order1:=xlAscending
    End Sub
    If I delete the Order1:=xlAscending it does the sort but orders descending!
    can anyone tell me what im doing wrong?

    Thanks

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482
    The the use of 2 different worksheet names deliberate?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-30-2008
    Location
    London
    Posts
    35
    Thanks Andy
    Easy to overlook! now ive altered it it works

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    i see you are applying this to your postcode problem which i posted and you never acknowledged. sample i posted sorts without resorting to macro.

+ 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