+ Reply to Thread
Results 1 to 13 of 13

Option Button VBA setup

  1. #1
    Registered User
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    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
    18,313

    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
    Registered User
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Option Button VBA setup

    Exactly.

    Thanks

  4. #4
    Registered User
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    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
    Ipswich, England
    MS-Off Ver
    Excel 2013 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    17,870

    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!
    If anyone has helped you towards solving a problem, then you can thank them by clicking on their reputation star bottom left.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2007
    Posts
    4,533

    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 Guru
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    3,459

    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
    Registered User
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    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
    18,313

    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
    Registered User
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    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
    2007
    Posts
    4,533

    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
    Registered User
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    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
    2007
    Posts
    4,533

    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)

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