Clearing Checkboxes

G

Guest

Hi,

I have numerous check boxes in a worksheet that I would like to clear automatically by running a macro. I already have a macro set up to clear some other cells in my worksheet and I would like to add this function to my macro. I am not familiar with Visual Basic at all so if you could help me out with what to place where I would be most appreciative. Here is an example of my macro code:

Sub Clear()
'
' Clear Macro
' Macro recorded 11/26/2003 by Jamie Bourne
'
' Keyboard Shortcut: Ctrl+a
'
Range("M42").Select
Selection.ClearContents
Range("M43").Select
Selection.ClearContents
Range("B4").Select
End Sub

Any thoughts?
 
P

Paul B

Jaime, this will clear the checkboxs, on the active sheet, from the forms
tool bar, if your checkboxs are from the control toolbox just post back,
also you do not have to select the cells you want to clear, just use some
code like below

Sub Clear()
'
' Clear Macro
' Macro recorded 11/26/2003 by Jamie Bourne
'
' Keyboard Shortcut: Ctrl+a
'
Range("M42,M43").ClearContents
ActiveSheet.CheckBoxes = False
Range("B4").Select
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
Jaime Andersen said:
Hi,

I have numerous check boxes in a worksheet that I would like to clear
automatically by running a macro. I already have a macro set up to clear
some other cells in my worksheet and I would like to add this function to my
macro. I am not familiar with Visual Basic at all so if you could help me
out with what to place where I would be most appreciative. Here is an
example of my macro code:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top