Solved

Radio button in Excell workbook

Posted on 2014-01-20
6
457 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
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 …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

776 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