+ Reply to Thread
Results 1 to 9 of 9

Issues with a sorting macro across multiple sheets

  1. #1
    Registered User
    Join Date
    05-22-2019
    Location
    Holland, Michigan
    MS-Off Ver
    Excel 2018
    Posts
    6

    Issues with a sorting macro across multiple sheets

    I have created a macro that sorts a set of numbers in a row from lowest to highest in a single sheet. I paired this macro to a shortcut so that it can be applied at will to any sheet in the workbook. However, the macro only seems to sort the values in the sheet which it was created and not in any of the other sheets. The macro doesn't give any errors and runs through the whole code, but the values in the other sheets are not sorted after it has been run. The data was originally located on different rows, but rows were added and then subsequently hidden in order to ensure that it was all in the same row and column (this was done outside of the macro). Is there a way for me to create a single macro with a shortcut key that will apply to all of the sheets?
    Last edited by aheisler; 05-22-2019 at 09:50 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Issues with a sorting macro across multiple sheets

    Post your existing code.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    05-22-2019
    Location
    Holland, Michigan
    MS-Off Ver
    Excel 2018
    Posts
    6

    Re: Issues with a sorting macro across multiple sheets

    Please Login or Register  to view this content.
    Last edited by aheisler; 05-22-2019 at 12:13 PM.

  4. #4
    Registered User
    Join Date
    05-22-2019
    Location
    Holland, Michigan
    MS-Off Ver
    Excel 2018
    Posts
    6

    Re: Issues with a sorting macro across multiple sheets

    sorry for the length, I had to remove and then re-add cells that were merged.

  5. #5
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Issues with a sorting macro across multiple sheets

    Whoa, whoa whoa...way to long and unreadable as a consequence

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

    I would normally have added them for you but given the length I don't have the time.

  6. #6
    Registered User
    Join Date
    05-22-2019
    Location
    Holland, Michigan
    MS-Off Ver
    Excel 2018
    Posts
    6

    Re: Issues with a sorting macro across multiple sheets

    Apologies, I have edited the code to the correct formatting.

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Issues with a sorting macro across multiple sheets

    Replace this (three spots)
    ActiveWorkbook.Worksheets("Selective Demolition")

    With just this...
    ActiveSheet

  8. #8
    Registered User
    Join Date
    05-22-2019
    Location
    Holland, Michigan
    MS-Off Ver
    Excel 2018
    Posts
    6

    Re: Issues with a sorting macro across multiple sheets

    This worked! Thank you so much! Will the same replacement work for macros for 3,4,5, and 6 bids that were having the same issue?

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Issues with a sorting macro across multiple sheets

    Probably.

    You're welcome and thanks for the feedback.

+ 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. [SOLVED] Issues protecting sheets when macro runs filter
    By colinjwatson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2016, 06:23 AM
  2. [SOLVED] Combining several small macros into one large one AND Conditional/Sorting Macro Issues
    By lashellr in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-10-2014, 11:59 AM
  3. Does SUMIFS have issues with merged cells or across multiple sheets??
    By dumaser88 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-09-2014, 01:04 PM
  4. Data Validation List Issues/Sorting Issues
    By taylorbe in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-12-2014, 09:53 AM
  5. [SOLVED] Issues with VLOOKUP/INDIRECT and retrieving from multiple sheets
    By nicolerork in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-28-2013, 12:53 AM
  6. Lookup Across multiple sheets + other issues
    By mikemartinlfs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-16-2012, 01:56 PM
  7. [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

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