+ Reply to Thread
Results 1 to 3 of 3

Value of an Option Button in VBA / Excel for Mac

  1. #1
    Registered User
    Join Date
    09-25-2019
    Location
    Rixensart, Belgium
    MS-Off Ver
    Excel 2019 for Mac, Version 16.68 and VBA for Apps 7.1
    Posts
    17

    Value of an Option Button in VBA / Excel for Mac

    Hello,

    I have option buttons in my Excel spreadsheet (Macbook, Mojave, Excel for Mac 16.46)
    Can someone tell me how I can check the value (True/False) of an option button in VBA?

    I have tried : If Optionbutton1.Value = True Then ...

    But I get the error: Run-time error '424': object required
    Which seems to mean VBA is not getting access to the object 'Option Button 1'.

    Any ideas ? Thanks.
    Last edited by Colin_in_Belgium; 03-11-2021 at 03:38 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Value of an Option Button in VBA / Excel for Mac

    You may need to replace the sheet reference if not the activesheet

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-25-2019
    Location
    Rixensart, Belgium
    MS-Off Ver
    Excel 2019 for Mac, Version 16.68 and VBA for Apps 7.1
    Posts
    17

    Re: Value of an Option Button in VBA / Excel for Mac

    The option appears in the same worksheet, but I decided to try your idea anyway ...

    This worked: If ActiveSheet.Shapes("Option Button 1").ControlFormat.Value = xlOn Then

    Excellent. Many thanks Andy !

+ 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. Can you refer to a radio option button group to just get the value of the option selected
    By pharmacologist in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-01-2020, 08:54 AM
  2. Option Button Excel VBA
    By melforce in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-25-2015, 11:42 PM
  3. [SOLVED] Message Box and Option Button in Excel
    By Building in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2014, 01:03 PM
  4. Replies: 2
    Last Post: 08-15-2013, 12:25 PM
  5. Excel VBA option button question
    By CindyG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2006, 10:52 AM
  6. [SOLVED] keep source formatting is not an option in paste option button
    By Tina in forum Excel General
    Replies: 0
    Last Post: 02-20-2006, 06:00 PM
  7. how do I add an option button in Excel
    By MO in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2005, 05:20 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