Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Posts
    19

    Unanswered: sort a to z on colum A

    I want a command button to sort on column A, to put column A in desending order A to Z,
    The database has 3 columns A to C.
    I require the code
    Thanks Graham

  2. #2
    Join Date
    Jan 2012
    Posts
    97
    Graham

    The following will select all cells in the worksheet and sort descending on column A assuming there is a header row.

    Code:
    Cells.Select
    Selection.Sort Key1:=Range("A2"), Order1:=xlDescending, Header:=xlYes, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    If you want to select the three columns only then replace
    Cells.Select with Columns("A:C").Select

    If there is no header row then replace
    Header:=xlYes with Header:=xlGuess
    Hope this helps,

    Dave.

    _____________

    Access 2000 User

  3. #3
    Join Date
    Feb 2012
    Posts
    19

    Thumbs up Thanks

    Many thanks Dave it works great
    Regards
    Graham

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •