+ Reply to Thread
Results 1 to 5 of 5

Sorting each worksheet in a workbook

  1. #1
    Forum Contributor
    Join Date
    07-30-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    118

    Sorting each worksheet in a workbook

    Hello Friends

    I have this piece of code which i use for sorting, there are two different range on the same worksheet which needs to be sorted and I need to loop through all the worksheet. But it only sorts the current worksheet where I start running the macro. The range to be sorted is same for all worksheet.

    Code is below:
    Please Login or Register  to view this content.
    Can anyone help me for sorting for every worksheet in a workbook?

    Response would be appreciated.

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

    Re: Sorting each worksheet in a workbook

    Like so:

    Please Login or Register  to view this content.
    _________________
    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!)

  3. #3
    Forum Contributor
    Join Date
    07-30-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    118

    Re: Sorting each worksheet in a workbook

    Hello Jerry

    The above code works fine , but the only problem is it does not sort the last worksheet in the workbook. Could you please suggest what needs to be done.

    Aprreciated.
    Last edited by JBeaucaire; 08-30-2012 at 10:42 PM. Reason: Removed whole post quote, unnecessary.

  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: Sorting each worksheet in a workbook

    Remove the - 1 from the FOR... line of code.


    If that takes care of your need,
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Forum Contributor
    Join Date
    07-30-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    118

    Re: Sorting each worksheet in a workbook

    Thanks Jerry for your quick response.

    Appreciated mate.

+ 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