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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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,223,157
Messages
6,170,420
Members
452,325
Latest member
BlahQz

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