+ Reply to Thread
Results 1 to 17 of 17

sort ascending order

  1. #1
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    sort ascending order

    Please open attached file and help me modify the code

    I need values from column F in ascending order.
    Also I need in column G only the values without formula.
    Attached Files Attached Files
    Last edited by iscar_marius; 02-11-2009 at 11:03 AM.

  2. #2
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    re: sort ascending order

    I need something like this:
    Please Login or Register  to view this content.
    but without ".Select". If I use "Select" this will not work:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    re: sort ascending order

    Try
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: sort ascending order

    it's not working, thanks anyway

  5. #5
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: sort ascending order

    I have this error if I use the above code:
    "Run-time error'1004'
    The sort reference is not valid . Make sure it's within the data you
    want to sort, and the first Sort By isn't the same or blank"

  6. #6
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: sort ascending order

    I found some documentation here about my question:
    http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

    The code posted by "shg" should work but I don't know why it doesn't.
    I have 1004 error.
    Please help!

  7. #7
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: sort ascending order

    My second problem ("Also I need in column G only the values without formula") is solved with the help of this forum user . I added gren code.
    My code looks like this now:
    Please Login or Register  to view this content.
    Now I only need to add some code that will sort ascending the value from column F. In column "F" I have only numbers.
    Thank you!

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: sort ascending order

    Please Login or Register  to view this content.
    I have added the sort to the code I posted to your other thread
    Cheers
    Andy
    www.andypope.info

  9. #9
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: sort ascending order

    This code will sort ascending also the formatting of the cells from column D, I need only the values to be sorted starting from row 3.
    In column D all cell are gray or yellow, if I run the macro, in column "D" I will have cell with the value, colored.

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: sort ascending order

    Just adjust the ranges being used.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: sort ascending order

    If I use this code:
    Please Login or Register  to view this content.
    it will work but,
    I need Column F and G starting with row 3.
    I need range "F1:G2" not to be affected!
    Please open attached file!
    I posted this question also on my other thread, sorry for that!
    Attached Files Attached Files

  12. #12
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: sort ascending order

    Please Login or Register  to view this content.
    Or you could do it to a different location and then just copy / pastespecial to move the values.

  13. #13
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: sort ascending order

    Only one problem, I have in range "G11" value 0, I don't need that value!
    Please open attached file!
    Thank you for your time!
    Attached Files Attached Files

  14. #14
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: sort ascending order

    The trailing zero is caused by the blank field header being sorted to the end of the list after the range has been set.
    Changing the order of things will resolve it.
    Please Login or Register  to view this content.

  15. #15
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: sort ascending order

    Please Login or Register  to view this content.
    I have 2 more question:

    1.It's nor possible to modiy the code so we don't need the red code (from above) ?

    2.It's nor possible to use this code (Multiply and count_unique) with:
    Please Login or Register  to view this content.
    ??
    Now the macro run for each "selection" but I would like to run for each "change"!

  16. #16
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: sort ascending order

    Advance filter uses the top row as fieldnames. So F2 will need to be cleared after running code.

    You need to disable events in order to avoid the Out of Stack Space warning.

    Please Login or Register  to view this content.

  17. #17
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: sort ascending order

    Thread solved
    Thank you!

+ 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