+ Reply to Thread
Results 1 to 13 of 13

Option Button VBA setup

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Option Button VBA setup

    Hi All,

    I cannot seem to figure out how to set up a macro for an Option Button. I want be able to set up a macro on a shape button to Call a different macro for each Option Button but cannot seem to find any code that will do this.

    Can anyone please assist?

    Thanks

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Option Button VBA setup

    Do you mean you have a group of option buttons that you want to use to determine which macro to call when the shape button is clicked?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Option Button VBA setup

    Exactly.

    Thanks

  4. #4
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Option Button VBA setup

    Is anyone able to help me with this one?

    Thanks

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,398

    Re: Option Button VBA setup

    I'm sure someone is, but bear in mind that for members in the UK and the US, New Year's Day is only just starting, so you may not get the help you require today.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Option Button VBA setup

    Please explain a scenario of how you would like this to work....Ideally upload a sample file...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

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

    Re: Option Button VBA setup

    Hi Ravenous,

    See post #2 in the following thread, including a working sample file that contains the code below: http://www.excelforum.com/excel-gene...rent-rows.html

    Typical code excerpt for assisgning a Macro to a Forms Option Button is:
    Please Login or Register  to view this content.
    Lewis

  8. #8
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Option Button VBA setup

    HI Lewis,

    I tried to download the example sheet from the thread you suggested but it is not displaying after I download it.

    In short I need a code for the below that will Call a different macro for each Option Button when Go is clicked:

    VyR6kl2.png

    I have tried this but it doesn't work (Keep in mind I have no idea what I am doing lol):

    Please Login or Register  to view this content.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Option Button VBA setup

    How does it not work?

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED, scroll down and click Manage Attachments.

  10. #10
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Option Button VBA setup

    Thanks Norie, Example attached.

    The error I get is:

    Run-time error '424':

    Object Required
    Attached Files Attached Files

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Option Button VBA setup

    Try ...
    Please Login or Register  to view this content.
    OR...
    Please Login or Register  to view this content.
    Last edited by sintek; 01-04-2018 at 02:31 AM.

  12. #12
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Option Button VBA setup

    Perfect! Thanks sintek

  13. #13
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Option Button VBA setup

    Pleasure, thanx for rep +

+ 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. Hide option buttons based on other option button
    By monfos in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2016, 05:16 PM
  2. I have NO CLUE as to how to setup an option button in Excel 2002 SP3
    By bryanr72 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-06-2016, 04:00 PM
  3. Replies: 2
    Last Post: 08-15-2013, 12:25 PM
  4. Option Buttons for Page Setup change when selected
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2012, 05:16 PM
  5. Replies: 0
    Last Post: 02-20-2006, 06:00 PM
  6. [SOLVED] Excel; how do I print titles in 'Setup' when option greyed out?
    By MLB in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-28-2005, 11:25 AM
  7. [SOLVED] Why is the Print Titles option in Page Setup:Sheet greyed out?
    By timz in forum Excel General
    Replies: 2
    Last Post: 09-06-2005, 10:05 AM

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