Solved

Radio button in Excell workbook

Posted on 2014-01-20
6
462 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 30

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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
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 …

729 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