+ Reply to Thread
Results 1 to 9 of 9

Hide OptionButton

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

    Hide OptionButton

    Hi Guys,

    I have an OptionButton for "New Sheet" on my worksheet, when selected and after clicking the "Go" command button, I get a copy "to end", of the active sheet without the data.

    What i would like is for the OptionButton to be only visible on the last (rightmost) sheet, then when this sheet is "copied to end" the OptionButton is again ONLY on the last (rightmost) sheet but not on / visible on previous sheets.

    TIA
    Keith

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Hide OptionButton

    Hello kjg,

    That would depend on what controls you are using. Would it be Form controls, or Active X controls.

    It would also be good if you could attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

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

    Re: Hide OptionButton

    Hi Winon,

    Thanks for your reply.

    I understand that it would be much better with a sample workbook. I did try to sanatise my workbook, but with references in the macros to data in the sheets also, I found it was going to be a large task, so "hope" you can help without it.

    The controls that I am using are ActiveX controls. As said before, the OptionButton should only appear on the last (rightmost) sheet and not on the preceeding sheet.

    Cheers,
    Keith

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Hide OptionButton

    Hi Keith,

    For completeness, two routines follow:
    a. Active X Option Buttons (as your requested)
    b. Forms Control Option Buttons

    In both cases you have to know the 'Option Button' NAME, and the NAME must be the same on all sheets.

    Lewis

    For Active X Option Buttons:
    Please Login or Register  to view this content.

    For Forms Option Buttons:
    Please Login or Register  to view this content.

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

    Re: Hide OptionButton

    Thanks for that LJMetzger,

    You guys never cease to amaze me, it worked great first time and each time, perfectly.

    Is there any way to have it do its thing “if” the last sheet were deleted, so the OptionButton would come back to the previous last sheet, sort of like the undo, only this may be after a save.

    I do appreciate your help, thanks,
    Keith

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Hide OptionButton

    Hello kjg,

    LJMetzger has provided you with a very good piece of good, and yes, even if you were to delete any of the farmost Sheets, the OptionButton will only show on the remaining last sheet.

    By using the Active X Option Buttons code in a standard module, one option to accomplish this would be to add the Code below in ThisWorkbook Code:

    Please Login or Register  to view this content.
    Nice job!, LJMetzger.

    Regards.

  7. #7
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Hide OptionButton

    kjg and Winon,

    Thank you both for the kind words.

    I don't think 'Workbook_SheetActivate()' is called when the Workbook opens. If this is the case, then the routine needs to be in 'Workbook_Open()' also.
    Please Login or Register  to view this content.
    Lewis

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

    Re: Hide OptionButton

    Thanks again guys.

    I used the code as suggested by Winon and it "seems" to be working perfectly. If I add a sheet and delete, if I close the workbook then re-open it then add a sheet and delete it, it still performs as expected.

    Brilliant, thank you both.

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Hide OptionButton

    Hello kjg,

    Thank you for the feedback, and for adding to my Reputation.

    You are welcome, glad we could help.

    Thank you also for marking this Thread as "Solved".

    Regards.

+ 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] Hide TextBox with OptionButton
    By zplugger in forum Excel General
    Replies: 4
    Last Post: 09-24-2012, 04:56 PM
  2. OptionButton
    By diono in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2008, 08:02 AM
  3. [SOLVED] for each optionbutton
    By masterphilch in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2005, 01:05 PM
  4. [SOLVED] optionbutton
    By benb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2005, 05:06 PM
  5. OptionButton value
    By Patrick Simonds in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2005, 07:06 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