+ Reply to Thread
Results 1 to 12 of 12

Sort in ascending order

  1. #1
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Sort in ascending order

    I have this macro running in 3 ranges, but this 3rd range will always have a product with amount of 0 on top, then the rest will follow order with the highest first????
    Why is this 0 on top when it should be at the bottom, or with the other 0s when there is no data????

    Yet I do not have a problem with the other two ranges?

    Here is the code (3rd section down is the issue):

    Please Login or Register  to view this content.


    The ranges work as follows:
    First column woul be a link (=) to the main sheet where products are inputted
    the 2nd,3rd,4th columns are Vlookups, which looks at the first column and returns figures for what ever is in the first column. 5th column adds these totals up.
    Macro should then sort this list in numerical order from the totals.

    Any ideas guys??


    Thanks

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sort in ascending order

    Hello Dibbley247,

    Did you check the number format of the 3rd Range?
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Sort in ascending order

    Hi, No I haven't when I created this, I was still learning, (still am) so didn't realise number formats would make a difference.
    But I've just done a refresh, and the sames happened in the first range also.
    But i'll try formatting anyway. Any particulat type of format for this?

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sort in ascending order

    Could you please upload a sample workbook for us to look at?

    I suspect that you are trying to Sort formulas.

  5. #5
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Sort in ascending order

    I think its too large to upload, so i'll have to adjust the single sheet to work. I'll take a look in a bit and see what I can do.
    Yes I never thought of it that way which would mess it up, it is formulas getting the results!

  6. #6
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Sort in ascending order

    WK10.xls

    The tab the list is on is (3D Overview) Theres a macro button which says "sort top 3" this will sort out the yellow sections to the right of this button.
    The list populated for this starts on the same sheet at Z98.
    All data populates from "costings" tab which it has to as I need other people to add in products from time to time and make the rest of the workbook work around being DUMB PROOF

    The macro for this is in module 7.

    Many sheets have been deleted so there will be alot of #REF on other pages as they have nothing to link too.
    Also this will be used on all versions of excel, so the code would need to work for 2003 version.

    You may die at the sight of some of the macro, but i'm learning still, Any pointers or any suggestions that you think would make this better would be welcomed (there's always an easier way to do something!!!)

    Thanks very much

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sort in ascending order

    I hope it is something along the lines of the attached Workbook, that you are looking for.

    The Code in ThisWorkBook Open Event I had to Comment, since you have deleted the Sheet it refers to. Remember to undo that should you wish to use this WorkBook. Otherwise you could just copy Module 7 and Sheet Overview 3D to your actual WorkBook.

    Also see the "Please Consider" note at the bottom of this post.

    Happy Coding.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Sort in ascending order

    Ok thanks, yeah I forgot about the openworkbook macro, it opens a specific sheet depending on the time/day, but had to delete all but one to load the book within the size limit.
    I'll take a look when I'm back on the PC tonight! I'll copy the module over and then the overview sheet, then I'll have to apply it to 3 other sheets which were deleted.
    Thanks for your time, and I'll let you know how I get on!

  9. #9
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Sort in ascending order

    Ok soooo there are now 2 columns with ALL products, but the macro basically copies and pastes the data as a value THEN sorts it....Which works!
    BUT
    What is the reason for it not working to begin with by using formulas?

    Thanks very much!!!!!!!!

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sort in ascending order

    Hello Dibbley247,

    BUT
    What is the reason for it not working to begin with by using formulas?
    Excel isn't supposed to sort formulas, as it could mess up the integrity of your Data. It should sort the values only.

    Also see this Link: http://stackoverflow.com/questions/9...formula-output

    Hope that helps!

  11. #11
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Sort in ascending order

    Strange how everything else went in order and the same one always stayed on top if there was no figure for it though.
    I'll keep that trick in mind for future workbooks!!!!
    Thanks for your help!

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Sort in ascending order

    You are welcome!

+ 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