Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Reset button code for Radio Buttons

I've created a form and I'm using Radio Buttons with an Option Box to
prevent the user from selecting multiple items. The problem is that
if by accident they choose one of the items within the option box and
don't really want that there is no way to clear the radio button. I'd
like to place a "reset" button in the form but don't know the code to
pub behind the button to clear all the radio buttons. Can someone
help me out please.....thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 470
Default Reset button code for Radio Buttons

You should be able to place the radio buttons within a "frame" (see control
box) and only be able to choose one radio button.

Les

" wrote:

I've created a form and I'm using Radio Buttons with an Option Box to
prevent the user from selecting multiple items. The problem is that
if by accident they choose one of the items within the option box and
don't really want that there is no way to clear the radio button. I'd
like to place a "reset" button in the form but don't know the code to
pub behind the button to clear all the radio buttons. Can someone
help me out please.....thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 533
Default Reset button code for Radio Buttons

Maybe a "None" option button.

--
Jim
wrote in message
...
| I've created a form and I'm using Radio Buttons with an Option Box to
| prevent the user from selecting multiple items. The problem is that
| if by accident they choose one of the items within the option box and
| don't really want that there is no way to clear the radio button. I'd
| like to place a "reset" button in the form but don't know the code to
| pub behind the button to clear all the radio buttons. Can someone
| help me out please.....thanks in advance.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 284
Default Reset button code for Radio Buttons

dworst

Place this in the worksheet module and attach it to your clear buttom or
keyboard short cut.

Sub testme()

Dim OptBTN As OptionButton
Dim OLEObj As OLEObject

For Each OptBTN In ActiveSheet.OptionButtons
OptBTN.Value = xlOff
Next OptBTN

For Each OLEObj In ActiveSheet.OLEObjects
If TypeOf OLEObj.Object Is msforms.OptionButton Then
OLEObj.Object.Value = False
End If
Next OLEObj

End Sub


Mike Rogers


" wrote:

I've created a form and I'm using Radio Buttons with an Option Box to
prevent the user from selecting multiple items. The problem is that
if by accident they choose one of the items within the option box and
don't really want that there is no way to clear the radio button. I'd
like to place a "reset" button in the form but don't know the code to
pub behind the button to clear all the radio buttons. Can someone
help me out please.....thanks in advance.

  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 53
Default Reset button code for Radio Buttons

Does this code work for buttons within Microsoft Frames?
--
TASR


"Mike Rogers" wrote:

dworst

Place this in the worksheet module and attach it to your clear buttom or
keyboard short cut.

Sub testme()

Dim OptBTN As OptionButton
Dim OLEObj As OLEObject

For Each OptBTN In ActiveSheet.OptionButtons
OptBTN.Value = xlOff
Next OptBTN

For Each OLEObj In ActiveSheet.OLEObjects
If TypeOf OLEObj.Object Is msforms.OptionButton Then
OLEObj.Object.Value = False
End If
Next OLEObj

End Sub


Mike Rogers


" wrote:

I've created a form and I'm using Radio Buttons with an Option Box to
prevent the user from selecting multiple items. The problem is that
if by accident they choose one of the items within the option box and
don't really want that there is no way to clear the radio button. I'd
like to place a "reset" button in the form but don't know the code to
pub behind the button to clear all the radio buttons. Can someone
help me out please.....thanks in advance.

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Reset button code for Radio Buttons

thanks alot..it worked for me :)






On Wednesday, February 13, 2008 9:09:02 PM UTC+5:30, Mike Rogers wrote:
dworst

Place this in the worksheet module and attach it to your clear buttom or
keyboard short cut.

Sub testme()

Dim OptBTN As OptionButton
Dim OLEObj As OLEObject

For Each OptBTN In ActiveSheet.OptionButtons
OptBTN.Value = xlOff
Next OptBTN

For Each OLEObj In ActiveSheet.OLEObjects
If TypeOf OLEObj.Object Is msforms.OptionButton Then
OLEObj.Object.Value = False
End If
Next OLEObj

End Sub


Mike Rogers


" wrote:

I've created a form and I'm using Radio Buttons with an Option Box to
prevent the user from selecting multiple items. The problem is that
if by accident they choose one of the items within the option box and
don't really want that there is no way to clear the radio button. I'd
like to place a "reset" button in the form but don't know the code to
pub behind the button to clear all the radio buttons. Can someone
help me out please.....thanks in advance.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
radio Buttons Kev Excel Discussion (Misc queries) 1 June 18th 07 07:26 PM
Help - Radio Buttons evo182 Excel Worksheet Functions 1 January 22nd 06 03:24 PM
Help - Radio Buttons evo182 Excel Worksheet Functions 0 January 22nd 06 03:02 PM
Radio Buttons Bethie at CLG Excel Worksheet Functions 6 October 31st 05 09:08 PM
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True Mcasteel Excel Worksheet Functions 2 October 29th 04 07:06 PM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"