+ Reply to Thread
Results 1 to 4 of 4

I need to sort an active sheet using the col of the active cell

  1. #1
    HamFlyer
    Guest

    I need to sort an active sheet using the col of the active cell

    My intent is to create a Sort Button that will read the Active Column for
    sorting the ActiveSheet.

  2. #2
    Otto Moehrbach
    Guest

    Re: I need to sort an active sheet using the col of the active cell

    One way:
    Sub SortByActiveCellColumn()
    Selection.Sort Key1:=Cells(2, ActiveCell.Column), _
    Order1:=xlAscending, Header:=xlYes, _
    OrderCustom:=1, MatchCase:=False, _
    Orientation:=xlTopToBottom
    End Sub
    I assumed your data has headers. Also, you have to select the entire range
    you want sorted before you run this macro. Post back if you want help with
    refining this to work with what you actually have. HTH Otto
    "HamFlyer" <[email protected]> wrote in message
    news:[email protected]...
    > My intent is to create a Sort Button that will read the Active Column for
    > sorting the ActiveSheet.




  3. #3
    Dave Peterson
    Guest

    Re: I need to sort an active sheet using the col of the active cell

    Maybe you can use the technique shown at Debra Dalgleish's site:
    http://www.contextures.com/xlSort02.html



    HamFlyer wrote:
    >
    > My intent is to create a Sort Button that will read the Active Column for
    > sorting the ActiveSheet.


    --

    Dave Peterson

  4. #4
    HamFlyer
    Guest

    Re: I need to sort an active sheet using the col of the active cel



    "Otto Moehrbach" wrote:

    > One way:
    > Sub SortByActiveCellColumn()
    > Selection.Sort Key1:=Cells(2, ActiveCell.Column), _
    > Order1:=xlAscending, Header:=xlYes, _
    > OrderCustom:=1, MatchCase:=False, _
    > Orientation:=xlTopToBottom
    > End Sub
    > I assumed your data has headers. Also, you have to select the entire range
    > you want sorted before you run this macro. Post back if you want help with
    > refining this to work with what you actually have. HTH Otto
    > "HamFlyer" <[email protected]> wrote in message
    > news:[email protected]...
    > > My intent is to create a Sort Button that will read the Active Column for
    > > sorting the ActiveSheet.

    >
    >
    > Thanks Otto

    That was just the clue I needed. All the other code is in place and working.
    Thanks again

+ 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