MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Excel Macros

  Asked By: Don    Date: Aug 15    Category: MS Office    Views: 1781

I have developed an excel spreadsheet and I need to add a button to
the spreadsheet that will clear the certain cells and reset all the
option buttons and check boxes. Are you aware of anyone who may be
able to help me with this. I can easily clear the cells but I don't
know how to get the macro to reset the option buttons and check



3 Answers Found

Answer #1    Answered By: Volker Fischer     Answered On: Aug 15

Where are the buttons  and boxes; are they on a VBA form or directly on
the sheet?

Are they ActiveX controls or form tools? Do they also output values to

Answer #2    Answered By: Marshall Bryant     Answered On: Aug 15

The buttons  and boxes  are directly on the sheet. I don't know the
difference between active x control and form tools. But I think that
they are form tools. They do output values to cells. If you want I
can send you an example of what I am talking about.

I have copied below an example of some of the code behind couple of
the buttons and check  boxes

Private Sub OptionButton3_Click()
Range("R2").Value = 1
End Sub

Private Sub CheckBox1_Click()

If CheckBox1.Value = True Then
ActiveSheet.Range("ab42").Value = 1

ActiveSheet.Range("ab42").Value = 0
End If
End Sub

Answer #3    Answered By: Jae Williams     Answered On: Aug 15

Resetting your objects is pretty easy really. You do it with
code like this:


Be sure also to clear  the cells  they are linked to.

Didn't find what you were looking for? Find more on Excel Macros Or get search suggestion and latest updates.