+ Reply to Thread
Results 1 to 4 of 4

Show/Hide tabs on one button

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Leeds
    MS-Off Ver
    Excel 2013
    Posts
    177

    Show/Hide tabs on one button

    Hi all,
    I have a basic question that I just don't know the answer to!

    I want to vba a button to show/hide tabs. I have the code to hide tabs:

    Sub Hide_Tabs()
    ActiveWindow.DisplayWorkbookTabs = False
    End Sub
    How do I add to the code so the buton shows on click then hides on click (and repeats)?

    Many Thanks!

    Luke

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Show/Hide tabs on one button

    Hi Luke,

    Sub Hide_Tabs()
    ActiveWindow.DisplayWorkbookTabs = Not ActiveWindow.DisplayWorkbookTabs
    End Sub
    If you like my contribution click the star icon!

  3. #3
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Leeds
    MS-Off Ver
    Excel 2013
    Posts
    177

    Re: Show/Hide tabs on one button

    Cheers Ollie! Working perfectly. Will the = work for any vba on a button for click action click another action?

    Cheers, Luke

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Show/Hide tabs on one button

    The '= not' will work for other switch on/off situations

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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