+ Reply to Thread
Results 1 to 6 of 6

Add a Sorting Code to the Original Code

  1. #1
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Question Add a Sorting Code to the Original Code

    Hello Gurus:

    Please help me add a sorting code to the original code so that the new code will sort "Quote Summary" sheet according to column C in Descending Order after the execution of the original code.

    The attached spreadsheet has been processed by the original code.
    Quote History-Process Sample v.2-Part c.xlsm

    Original Code:

    Please Login or Register  to view this content.
    Any input is appreciated,

    Chris

  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: Add a Sorting Code to the Original Code

    Hello Chris,

    This macro is called by the macro you posted. It will sort the "Quote Summary" in descending value using column "C".

    Original Posted Macro
    Please Login or Register  to view this content.
    New Macro To Sort Quote Summary
    Please Login or Register  to view this content.
    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
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Re: Add a Sorting Code to the Original Code

    Dear Leith:

    It is really nice to get response from you again!

    The call function works like a charm and it is really convenient when I want to put multiple codes together in the future.

    However, I am wondering if there is a way to actually combine these two codes together into one. I thought about to simply put them together but I worried about that the original code may include the sorting code for every loop. Which make the combined code very inefficient.

    Is there a something that I can used to make sure the sorting code is in after the execution of all of the loops of the original code?

    Thank you Leith!

    Chris

  4. #4
    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: Add a Sorting Code to the Original Code

    Hello Chris,

    Here is the macro with the sorting routine as a single macro.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Re: Add a Sorting Code to the Original Code

    This is Great! Thank you Leith!

  6. #6
    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: Add a Sorting Code to the Original Code

    Hello Chris,

    You're welcome.

+ 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. Stuck: Need help with original vba code for irr & payback function
    By bkuchen in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-25-2014, 02:04 PM
  2. Code for reverting cell format back to the original one
    By kairab in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2013, 01:14 AM
  3. Create Search in column E for amount.Patel 45 your original code
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-28-2012, 03:51 PM
  4. Replies: 0
    Last Post: 11-24-2012, 02:31 AM
  5. Code only works on a copy of the original sheet
    By timmtamm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2012, 01:07 PM

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