+ Reply to Thread
Results 1 to 4 of 4

Auto Sort using Macro

Hybrid View

  1. #1
    Rubix
    Guest

    Auto Sort using Macro

    I wish to auto sort text and numbers in two columns and on 5 rows
    descending. Is it possible to do this using Visual Basic?

    Thanks,
    Rube

  2. #2
    Rubix
    Guest

    Re: Auto Sort using Macro

    Columns would be s & t. Rows 18-22

    Rube

  3. #3
    Ken Puls
    Guest

    Re: Auto Sort using Macro

    Hello,

    This was paired down from a macro recording:

    With ActiveSheet.Range("S18:T22")
    .Sort Key1:=Range("S18"), Order1:=xlAscending, Header:=xlGuess
    End With

    If you wanted to sort by column T, change that in the second line of the
    code.

    Hope it helps,
    --
    Ken Puls
    www.officearticles.com

    "Rubix" <whims123@hotmail.com> wrote in message
    news:tljcn11rb664r24roedpbn9ord9f23vqkl@4ax.com...
    > Columns would be s & t. Rows 18-22
    >
    > Rube




  4. #4
    Rubix
    Guest

    Re: Auto Sort using Macro

    Thanks so much for your response.

    I'm not sure if I am doing this right but in VBAProject under
    ThisWorkbook I have:

    Private Sub Workbook_Open()
    With ActiveSheet.Range("S18:T22")
    .Sort Key1:=Range("T18"), Order1:=xlDescending, Header:=xlGuess
    End With
    End Sub

    This sorts column T but only when the spread sheet opens. I wish for
    auto sorting while data is added.

    Sorry I'm a newbie at this sort of thing.

    Rube



    On Sat, 12 Nov 2005 20:52:42 -0800, "Ken Puls"
    <ken.puls.nospamplease@gmail.com> wrote:

    >Hello,
    >
    >This was paired down from a macro recording:
    >
    >With ActiveSheet.Range("S18:T22")
    > .Sort Key1:=Range("S18"), Order1:=xlAscending, Header:=xlGuess
    >End With
    >
    >If you wanted to sort by column T, change that in the second line of the
    >code.
    >
    >Hope it helps,



+ 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