Return to sheet after a macro that adds sheets is run

  • Hi Everyone,

    I have a macro that adds new sheets depending on the previous name of the previous one. So here we have day shifts and night shifts so each day has 2 sheets allotted to it. There is a template sheet that this macro copies and uses to make the new ones. It looks at the previous sheet name
    (ex: 06-17-2019 DS). This is for June 17th Day Shift. If I run the macro it will make a sheet called 06-17-2019 NS for June 17th Night Shift. It will run for as many days as I tell it to (this is referenced in another sheet in the workbook).

    My problem I'm having is that I want it to automatically open the proper sheet once it is done running. If I run the macro for "7 days" then it will open up on 06-24-2019 D. But I want to call this days shift.
    Ex: the shift starting is 06-17-2019 DS but there is no sheet for this shift yet, the last sheet is called 06-16-2019- NS. So I run the macro, it adds sheets then opens the last one 06-24-2019 DS. I don't want it to open that sheet, I want to open 06-17-2019 DS (the next sheet).

    Thanks in advance :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!