+ Reply to Thread
Results 1 to 16 of 16

Need macro that clears option buttons made with the control toolbox

  1. #1
    Registered User
    Join Date
    09-25-2012
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2003
    Posts
    9

    Need macro that clears option buttons made with the control toolbox

    I created some excel 2003 spreadsheets to use for Fire/Police dispatchers. I have a series of yes/no option buttons that were created using the control toolbox. I have a macro that clears all the blanks where text is added, but want to add a line that clears the option buttons also.

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

    Re: Need macro that clears option buttons made with the control toolbox

    Set the linked cells to FALSE
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-25-2012
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Need macro that clears option buttons made with the control toolbox

    Thanks Andy. I think I am on the right track, but want to write it once for all the 30+ worksheets. How do I modify the following code or do I need to retype for each sheet?
    Please Login or Register  to view this content.

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

    Re: Need macro that clears option buttons made with the control toolbox

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-25-2012
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Need macro that clears option buttons made with the control toolbox

    Not sure what I am doing wrong, but your code runs without any errors, but the radio buttons won't clear. Thanks for trying. If it matters, I am not using a form.

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

    Re: Need macro that clears option buttons made with the control toolbox

    post example workbook

  7. #7
    Registered User
    Join Date
    09-25-2012
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Need macro that clears option buttons made with the control toolbox

    Sorry it took so long to get back to you.
    Here are two macros that I have for each of the 30+ worksheets that I am using. One saves the info to the hard drive and one clears the typed data. Would like to add one that will clears radio buttons. I still have to input the radio buttons onto the worksheet. Am using check boxes for now.
    Please Login or Register  to view this content.

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

    Re: Need macro that clears option buttons made with the control toolbox

    assuming the ranges are the cells linked to the controls

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-25-2012
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Need macro that clears option buttons made with the control toolbox

    I have the radio buttons as "option buttons". They are the same number on each worksheet (OptionButton1, etc). They are not linked to a specific ranges. When I put in your recommendation, it confused the program because two macros had the same name. So I changed yours to Clear_Fire_Buttons, but it said there was an invalid or unqualified reference. How can you just set values of all OptionButtons on a worksheet to False? Wouldn't that clear them?

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

    Re: Need macro that clears option buttons made with the control toolbox

    I missed the sheet reference

    Please Login or Register  to view this content.
    But any way that code will not do anything to the controls if they are not linked to those cells.

    Post a small example file.

  11. #11
    Registered User
    Join Date
    09-25-2012
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Need macro that clears option buttons made with the control toolbox

    Rules won't allow me to attach a file.

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Need macro that clears option buttons made with the control toolbox

    Quote Originally Posted by 79rotorhead View Post
    Rules won't allow me to attach a file.
    What do you mean by that? Rules by whom?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  13. #13
    Registered User
    Join Date
    09-25-2012
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Need macro that clears option buttons made with the control toolbox

    OK. Since I didn't understand the attachment loading procedures, I assumed it was not allowed. Sorry. Excel program attached. Thanks.
    Attached Files Attached Files

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

    Re: Need macro that clears option buttons made with the control toolbox

    try this

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    09-25-2012
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Need macro that clears option buttons made with the control toolbox

    Thanks Andy. It works great. You're amazing. Now to try to understand what you wrote.

  16. #16
    Registered User
    Join Date
    09-25-2012
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Need macro that clears option buttons made with the control toolbox

    Andy, the government switched from excel 2003 to 2010. Now the program doesn't work. the buttons no longer function and the clear function no longer works results in an error statement.

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

    Re: Need macro that clears option buttons made with the control toolbox

    In what what way does it not work? What are the details of the error
    Can you post latest workbook

+ 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. Radio Buttons in cells without control toolbox
    By tracktor in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2009, 10:18 PM
  2. Using control toolbox's option buttons to switch between vlookup tables
    By da_sprite in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2009, 05:45 AM
  3. [SOLVED] Vanishing Control Toolbox Command Buttons
    By Fritz24 in forum Excel General
    Replies: 2
    Last Post: 06-07-2005, 09:05 AM
  4. How to put a button made through Control Toolbox
    By jose luis in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2005, 03:50 AM
  5. No control for option buttons, invisible macro??
    By Steve in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2005, 10: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