+ Reply to Thread
Results 1 to 5 of 5

Button visible on 'last sheet only' not working as expected

  1. #1
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    205

    Button visible on 'last sheet only' not working as expected

    In the attached workbook I have 1 sheet with a command button to add another sheet to the end, this works fine.

    I only want the button to be visible on the last sheet.


    I “seem” to have the code in place for this to happen, (code from the web and modified) but, it doesn’t happen as expected.


    If I choose the sheet before the last sheet, the button is still visible. In debug mode, using debug.print, I get the expected results in the Immediate Window.


    Strangely, when on the sheet, if I 'enter and exit' Design Mode, the button disappears.


    I have also noticed, when I press the Add New Sheet button, I get an extra tab on the tool bar Drawing Tools.


    Anyone got a solution?
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Button visible on 'last sheet only' not working as expected

    Hi. do you want the button to be visible or why not just have the button appear on the last added sheet.
    What I mean, just 'move' the button to the newest sheet and while the button is there the sheet should be read-only until you add a new sheet.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    205

    Re: Button visible on 'last sheet only' not working as expected

    That sounds as if it might be something that could work. I have never heard of this sort of proceedure before. How would you do that? I have no idea how to do it

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Button visible on 'last sheet only' not working as expected

    I played around a little but I guess that wasn't such a bright idea.
    I did however modify your code a little, the worksheet with the button visible is protected (no password) all other unprotected.
    Of course the code could be more elaborated.
    When you delete worksheets it could be that the button remains invisible.
    Press Shift+Ctrl+N to run the macro and the button will showup again
    Attached Files Attached Files
    Last edited by Keebellah; 09-15-2017 at 04:22 PM.

  5. #5
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    205

    Re: Button visible on 'last sheet only' not working as expected

    Thank you for that solution, that will do what I need. I will play with it and try to learn.

+ 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] my add button not working as expected, i have included the workbook, see navigation sheet
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2016, 04:04 PM
  2. Macro Button not working for protected Sheet
    By sunny81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2015, 02:24 AM
  3. Protect sheet button is not working
    By Sophster in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-23-2011, 07:35 AM
  4. Cell/sheet protection not working as expected
    By LAF in forum Excel General
    Replies: 3
    Last Post: 09-24-2010, 01:04 AM
  5. Cell/sheet protection not working as expected
    By LAF in forum Excel General
    Replies: 1
    Last Post: 06-08-2010, 01:09 PM
  6. Making one sheet visible once a Week or when command button is pressed
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2008, 04:34 PM
  7. Button on a sheet always visible
    By avveerkar in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-11-2006, 10:28 AM

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