+ Reply to Thread
Results 1 to 2 of 2

VBA Back Button to go back through history of previously active worksheets.

  1. #1
    Registered User
    Join Date
    04-21-2020
    Location
    Ottawa, Canada
    MS-Off Ver
    2016
    Posts
    1

    VBA Back Button to go back through history of previously active worksheets.

    I'm trying to use VBA to create a "Back" button that allows me to go back through, in order, a series or previously active worksheets.

    I have a an Excel (2016) workbook with over 200 worksheets and I use a "Navigation Bar" (i.e. Group of simple "Goto" macros) at the top of each worksheet to navigate between 6 different "Modules" within the same workbook. The "Primary" Navigation Bar allows me to navigate to "Secondary" sub-menus within in each of the "modules" using other "Goto" macros. From there I can drill down to more levels, ultimately drilling down up to 5 levels.
    The code below works if I continue to "drill-down" within the same module. It allows me to return all the way back to Level 1 (i.e. The MainPage), however, something goes wrong when I try to:
    • - Move "up and down" within the same module (i.e. If I'm at a 3rd Level of menus and select an option to take me to the 4th level and use the "Back" Button to bring me back to the 3rd Level and then select a different path to get to the 4th level, when I use the "Back" button again, instead of bringing me back to the 3rd Level, it brings me back to the 2nd Level.

    Any advice or guidance you can provide would be greatly appreciated. Thank you in advance!

    In VBA Module

    Please Login or Register  to view this content.
    Last edited by Lexcon07; 04-22-2020 at 03:36 AM. Reason: Updated Code

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: VBA Back Button to go back through history of previously active worksheets.

    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 tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. 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

    I did it for you this time. Please read forum rules. Thanks

+ 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: 15
    Last Post: 09-05-2017, 07:35 PM
  2. Team Generator Kids Soccer - no back to back play
    By EWolfe in forum Excel General
    Replies: 2
    Last Post: 05-15-2017, 10:51 PM
  3. Excel files revert back to previously saved versions
    By kitkatkelly in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 11-17-2015, 02:14 AM
  4. Replies: 1
    Last Post: 03-11-2015, 07:27 AM
  5. Replies: 1
    Last Post: 07-07-2014, 09:19 AM
  6. Printing two worksheets so they are back to back
    By TallOne44 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 12-06-2012, 06:07 AM
  7. Data reverts back to previously saved version
    By mabell in forum Excel General
    Replies: 1
    Last Post: 06-11-2007, 10:07 PM

Tags for this Thread

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