Solved

Radio button in Excell workbook

Posted on 2014-01-20
6
458 Views
Last Modified: 2014-01-20
I tested a MS workbook with several radio buttons.  After finishing tests, I want to delete the selection in the radio buttons, but I don't know how.  Anyone can help me on this?
0
Comment
Question by:jjxia2001
  • 3
  • 2
6 Comments
 
LVL 29

Expert Comment

by:gowflow
ID: 39795209
what do you mean delete the selection in the radio button ? delete the button itself ?
not clear.
Can you post the workbook ?
gowflow
0
 

Author Comment

by:jjxia2001
ID: 39795253
Sorry, not delete the radio buttons, but not select any of the selections.  When users open the workbook, I don't want them to see any of selection has been checked in any radio buttons.  Hope this is clear.  If not, let me know.
0
 
LVL 12

Assisted Solution

by:Harry Lee
Harry Lee earned 200 total points
ID: 39795456
jjxia2001,

One of the radio button in a radio buttons group must be selected. That's why it is call radio buttons.

If you want to be able to clear the selection of a control object, you should use check boxes.

If you really need to clear the radio buttons, you will have to use VBA to clear them.

Use code like,
ActiveSheet.OptionButton1.value = False
ActiveSheet.OptionButton2.value = False
ActiveSheet.OptionButton3.value = False
ActiveSheet.OptionButton4.value = False

You will have to do it one by one.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:jjxia2001
ID: 39795481
I attach the workbook here.  For Security Exposures radio box(B30-F31), currently Middle Third is selected because I'm doing testing.  Now I want to send this workbook to users, so I want to un-select Middle Third.  But it seems the only way to un-select Middle Third is selecting another one (such as Higher Third ot Lower Third).  But I don't want anyone is selected when users open this workbook.  Thanks in advance.
CAG-WC-KE-02172014-01202014.xlsm
0
 
LVL 12

Accepted Solution

by:
Harry Lee earned 200 total points
ID: 39795491
jjxia2001,

Or you can use the following code to clear all of it at once.

Sub ClearRadioButtons()
Dim i As Long
    With ActiveSheet
        For i = 1 To .OLEObjects.Count
            If TypeName(.OLEObjects(i).Object) = "OptionButton" Then
                .OLEObjects(i).Object = False
            End If
        Next i
    End With
End Sub

Open in new window

0
 

Author Closing Comment

by:jjxia2001
ID: 39795512
Thanks.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question