+ Reply to Thread
Results 1 to 2 of 2

Macro to go back to the last active sheet and hide the active sheet

  1. #1
    Registered User
    Join Date
    08-19-2014
    Location
    istanbul
    MS-Off Ver
    2007
    Posts
    1

    Unhappy Macro to go back to the last active sheet and hide the active sheet

    Hello All,

    I use the macro below to go back to the last active sheet and it works.

    Public LastWorksheet As String

    Sub PreviousSheet()
    If LastWorksheet <> "" Then
    Worksheets(LastWorksheet).Activate
    Else
    MsgBox "No other Sheet has been selected."
    End If
    End Sub

    I also want to hide the active sheet before turning back to the last active sheet and add something like this to the above code but somehow it doesnt work.

    ActiveSheet.Visible = False

    Any help would be much appreciated!

  2. #2
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Macro to go back to the last active sheet and hide the active sheet

    Please Login or Register  to view this content.
    Thank those who have helped you by clicking the Star * below their name and please mark your post [SOLVED] if it has been answered satisfactorily.

+ 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: 1
    Last Post: 07-07-2014, 09:19 AM
  2. Macro with reference to active chart on active sheet
    By bhavikpatel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2014, 10:43 AM
  3. Macro to Print active sheet as PDF to Active workbook and customize name
    By Scott Taylor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-17-2012, 08:52 PM
  4. [SOLVED] Active sheet shifts back to original sheet when executing code
    By pcdog in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 10-22-2012, 11:07 AM
  5. Copy from active sheet and paste into new sheet using info from cell in active
    By Ingve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2006, 06:00 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