+ Reply to Thread
Results 1 to 9 of 9

Sort Descending

  1. #1
    Forum Contributor
    Join Date
    12-01-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    104

    Sort Descending

    Hello Excel Gurus:

    I need help for the revision of the VBA code below to sort DESCENDING on the “TR DATE “ (starting from cell Y7).

    Any help would be appreciated.

    Thank you.
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Sort Descending

    Hello GEMINI52,

    There is a lot going on here with references. It would be best if you upload a copy of the workbook for review.

    If your workbook contains any personal, private, or confidential information then please redact it before you post.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    12-01-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    104

    Sort Descending

    Hello Leith Ross,

    Here is the file that was requested.

    The attached file has 2 sheets, dBase and PubQ1 sheet and has a working code. Type the pub number on cell “B3” and it will display KEY DATE, KEYED BY, TR DATE, TR TYPE, TR QTY, UNIFIED LOC and COMMENT coming from dBase sheet.

    The revision I want is result to be sorted (descending) on the TR DATE and display only the 6 column (KEY DATE, KEYED BY, TR DATE, TR TYPE, etc.). As of now the column that I don’t want to show is just hidden.

    Also, please check the code to set the print area is correct.

    If the code has to be changed, it is most welcome. I have 25,000 rows and it runs slow.

    Thank you and hope to receive your revision ASAP.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sort Descending

    separate threads merged.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Sort Descending

    Try replace sheet module code with (Deleted Sheet_Activate code)
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jindon; 11-21-2015 at 05:49 PM. Reason: File attached

  6. #6
    Forum Contributor
    Join Date
    12-01-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    104

    Re: Sort Descending

    Thank you for your quick response and will let you know once i tested it. Happy thanksgiving.

  7. #7
    Forum Contributor
    Join Date
    12-01-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    104

    Re: Sort Descending

    Tested the code and it works but a little bit slow on 25K rows. I few more twerks i need on sheet "PubQ1" (if i may?)

    The revisions i need:
    1. When you type on cell "B3", i want it in all CAPS even if you type in small caps.
    2. Keep formatting on destination cells (A8:G)
    3. Always set filter from cell (A8:G) and
    4. The sheet should be protected.

    I am a newbie on macro code, so forgive me for my ignorance.

    I hope you can help me again. Thank you...

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Sort Descending

    Not sure about 2).

    Sheet protected under "password"
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    12-01-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    104
    Hello again,
    It works perfectly for my needs, two more request.
    1. Can you add a second sort? UNIFIED LOC (ascending)
    2. Cell B3 is merge with C3 and D4 and it does not clear A8:G when cell B3 is blank.

    Just for curiosity:
    CurrentRegion has 6 commas between 2 and True, what does it represent.
    Likewise, me.Protect... has 14 commas,
    Please educate me.

    Thank you...



    QUOTE=jindon;4247948]Not sure about 2).

    Sheet protected under "password"
    Please Login or Register  to view this content.
    [/QUOTE]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Data sort then sort of same value in descending days of the week
    By jimbob121 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2014, 02:32 PM
  2. [SOLVED] Sort Table Descending
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2013, 03:05 AM
  3. [SOLVED] Sort descending not bound to worksheet.
    By Rob* in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2012, 05:21 AM
  4. [SOLVED] Sort a column descending: VBA
    By niko79542 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2012, 04:16 PM
  5. VBA to sort column descending - can't get it right!
    By wonderdunder in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2011, 04:29 AM
  6. Using sort descending in VBA
    By eonizuka in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-05-2010, 06:05 PM
  7. Sort in descending order
    By shahcu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2008, 03:01 AM

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