Macro to save data then clear/reset option buttons

nk12707

New Member
Joined
Oct 5, 2008
Messages
1
Hi,

I am trying to create a macro that will first save the data entered then reset the option buttons. I have tried several things, but no luck so far. Any help that you could give would be appreciated. Thanks!

Nate
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hello,

You need to supply further information, and post the code you have created.
 
Upvote 0
Hi, Nate,
WELCOME to the BOARD!!!!!

You will need to provide a bit more information if the next won't help...
If your optionbuttons have a linked cell, an easy way to reset them is to clear their linked cells.

Else you can use code like this
Code:
Sub reset_optionbuttons()
'Erik Van Geit
'050517 0053
 
Dim sh As Shape
 
    For Each sh In ActiveSheet.Shapes
      If sh.Type = msoOLEControlObject Then
        If TypeName(sh.OLEFormat.Object.Object) = "OptionButton" Then sh.OLEFormat.Object.Object.Value = False
      End If
      If sh.Type = msoFormControl Then
        If sh.FormControlType = xlOptionButton Then sh.OLEFormat.Object.Value = False
      End If
    Next sh
 
End Sub
This would reset all possible option buttons, created with FORMS toolbar and CONTROLS toolbar.

kind regards,
Erik<SCRIPT type=text/javascript> vbmenu_register("postmenu_1704899", true); </SCRIPT>
 
Upvote 0

Forum statistics

Threads
1,215,453
Messages
6,124,930
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top