+ Reply to Thread
Results 1 to 11 of 11

Sorting Multiple Sheets With One Macro

  1. #1
    Forum Contributor
    Join Date
    11-30-2020
    Location
    Ny
    MS-Off Ver
    Office 365
    Posts
    173

    Sorting Multiple Sheets With One Macro

    In the workbook provided im trying to write one macro to work on 10 sheets. I'm want the table H26:U45 to be sorted by the value in J26. I can write a macro to work on each sheet individually, (as you can see) however, is there a way to write one macro to be called from each worksheet individually and not update all 10 at once? Thanks in advance!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: Sorting Multiple Sheets With One Macro

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-30-2020
    Location
    Ny
    MS-Off Ver
    Office 365
    Posts
    173

    Re: Sorting Multiple Sheets With One Macro

    thanks for the help, but i just wanted it to work on the one sheet it was called from, not all sheets at once. thanks again.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Sorting Multiple Sheets With One Macro

    A quick way would be to change this
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-30-2020
    Location
    Ny
    MS-Off Ver
    Office 365
    Posts
    173

    Re: Sorting Multiple Sheets With One Macro

    maybe im explaining this wrong. if im on sheet 2 I want to run the sort macro on just that sheet, if im on sheet 6 run it on just that sheet. If i write a macro for each sheet it works just fine, just hoping for one macro to be written.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Sorting Multiple Sheets With One Macro

    Did you try what was suggested?
    If you change as suggested and run the same macro (in this case the macro for week 3) from any sheet, what happens"

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Sorting Multiple Sheets With One Macro

    Please Login or Register  to view this content.
    I have not looked at any other changes that should be done but if this does what you want for all sheets you should be on your way to being a star.

  8. #8
    Forum Contributor
    Join Date
    11-30-2020
    Location
    Ny
    MS-Off Ver
    Office 365
    Posts
    173

    Re: Sorting Multiple Sheets With One Macro

    i tried what you said in the first post and didn't get it to work, however I was sidetracked several times, I tried the new code and it works like a charm! I don't know how to thank you enough other than adding to your rep! Once again (Hand Shake) thank you I learned something today !!!!!

    And Now with no interruptions I tried the first way once again and that worked as well, thanks once again!

    ~Bob
    Last edited by Tubtech; 05-27-2022 at 04:59 PM.

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Sorting Multiple Sheets With One Macro

    Good to hear all is well now.
    Thanks for letting us know and good luck.

    As I mentioned, just a quick way to get you back on track. Normally I would extract the index number of the open sheet and use that.
    There are many different ways of doing it and maybe someone will jump in to show a different way.

  10. #10
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Sorting Multiple Sheets With One Macro

    Does this do the same thing for you?
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    11-30-2020
    Location
    Ny
    MS-Off Ver
    Office 365
    Posts
    173

    Re: Sorting Multiple Sheets With One Macro

    that one works as well and is a lot more concise, you're great!

+ 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. Replies: 7
    Last Post: 11-28-2020, 06:55 PM
  2. [SOLVED] Sorting Multiple Sheets
    By Brendon Waters in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2020, 10:26 PM
  3. Issues with a sorting macro across multiple sheets
    By aheisler in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-22-2019, 12:30 PM
  4. Need help with Sorting across multiple sheets
    By jiggy2013 in forum Excel General
    Replies: 2
    Last Post: 09-19-2013, 03:51 PM
  5. [SOLVED] Sorting on Multiple Sheets with Same Macro
    By achenbachwb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2012, 03:41 PM
  6. Sorting into multiple sheets
    By Seisbye in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2012, 08:11 AM
  7. Sorting across multiple sheets
    By tedfineburger in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-23-2007, 11:53 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