+ Reply to Thread
Results 1 to 7 of 7

Automatic sheet switcher based on time

  1. #1
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    311

    Automatic sheet switcher based on time

    Hello.

    We use excel as a production result presentatiation. In the same workbook we have many sheets which we would like excel to automatically switch between and loop through.

    Example:

    Sheet A : 10 seconds
    Sheet B: 10 seconds
    Sheet C: 15 seconds
    Sheet D: 20 seconds

    Then loop and begin again with Sheet A.
    Maybe we can have Cell A1 on each sheet which tells how long time this sheet should be visible.
    We need to be able to start and stop the looping when we enter edit mode. After leaving edit mode we need to start looping again with a button.

    Do anyone have the time to support how to do this in VBA?


    /Anders

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,050

    Re: Automatic sheet switcher based on time

    Here's what I did. In the "ThisWorkbook" module I added the following:

    Please Login or Register  to view this content.
    That starts the cycle when the workbook is opened and cancels it when an edit is made or the workbook is closed. In a separate module I then had:

    Please Login or Register  to view this content.
    This is the code that switches the sheets based on the number of seconds specified in A1 of each sheet. I also added a button to the first sheet to re-start the cycle after an edit. See attached.

    WBD
    Attached Files Attached Files
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    311

    Re: Automatic sheet switcher based on time

    Fantastic. It works perfect.
    I have some sheets I don't want to cycle through. Is it a way to alter the code so that only selected sheets are included in the loop?
    I have 8 sheets in total but only want four to be part of the loop.

    /Anders

  4. #4
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    311

    Re: Automatic sheet switcher based on time

    I also got an error when I had two workbooks open. Maybe the code can avoid this by adding the name of the workbook it should loop?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    37,350

    Re: Automatic sheet switcher based on time

    For the error, try changing:
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  6. #6
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,050

    Re: Automatic sheet switcher based on time

    ThisWorkbook module:

    Please Login or Register  to view this content.
    Code module:

    Please Login or Register  to view this content.
    See also attached.

    WBD
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    311

    Re: Automatic sheet switcher based on time

    I am amazed!!

    This solves all my questions!!! A very big thank you!!!

    If I would like to stop the loop with a button. What code should I use?
    Last edited by a94andwi; 01-27-2022 at 11:24 AM.

+ 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] Time Sheet automatic dates stop at end of month
    By larkumharrison in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-17-2019, 04:09 PM
  2. Apple like Switcher in Excel
    By brisardo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2017, 02:52 PM
  3. Automatic Actions Based off Computer Time Stamp
    By veedubnut115 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2015, 04:03 PM
  4. Automatic date changes in a time sheet.
    By ryfly65 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-04-2015, 04:15 PM
  5. Excel Tasks in Month switcher
    By LandsHeer in forum Excel General
    Replies: 10
    Last Post: 07-24-2014, 11:24 AM
  6. Conditional Formula Switcher
    By no dice in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-22-2008, 01:40 AM
  7. Automatic Calculation:Time sheet
    By raweber in forum Excel General
    Replies: 0
    Last Post: 08-22-2005, 03:31 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