Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Sort in memory (Excel 2000)

    Hi all,

    In a workbook, I have three columns with vaules, the first value is total hours, the second is a name, and the third is number.

    I can easily sort the list now with a sub. What I would like to know is, is it possible to sort a variable in memory ? like what I have done with the list with three columns.

    Just a question -


    Thanks,
    Darryl.


    Public Sub Sortie()

    Range("A1").Select
    Range("A100:C116").Select
    Selection.Sort Key1:=Range("A100"), Order1:=xlAscending, Key2:=Range( _
    "C100"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _
    :=False, Orientation:=xlTopToBottom
    Range("A1").Select
    End Sub

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Sort in memory (Excel 2000)

    Not sure exactly what you are after.

    You can read the data into an array, use some sorting technique to sort the array (eg a bubble sort) and the array variable is sorted "in memory". You can then do something with the array in code or put it into the spreadsheet.

    What exactly are you after?

    Steve

  3. #3
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Sort in memory (Excel 2000)

    Hi Steve,

    Bubble sort?
    I have never heard that one before.
    Could I send you a file?
    The information isn't really sensitive but there are names in the list.
    Darryl.

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Sort in memory (Excel 2000)

    VB Helper Tutorial: Sorting It Out

    <post#=414984>post 414984</post#> has a bubble sort routine to do a 2d array

    I prefer all files be posted here. (you can change the names to protect the innocent)

    I still don't understand what you are trying to do...

    Steve

  5. #5
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Sort in memory (Excel 2000)

    Hi Steve thanks for your reply

    I am sure that what I am talking about is a bubble sort...I just didn't know the term. VB Helper looks like a great website thanks.

Posting Permissions

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