Clear Check Boxes Without VBA

Vampyre

New Member
Joined
Mar 23, 2011
Messages
30
Hi, I have an autoshape , that im using as a button to clear the rest of my form. i want to use this to also clear 2 clusters of check boxes.

Im not very hot on vba and would really like to do it using a macro, any ideas ??

as simple as possible please

Cheers
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
In a new module in your workbook. Open the VB Editor (Alt+f11), then choose Insert-Module and paste that code in.
 
Upvote 0
Hi ive added this one

Sub ResetFormsCheckBoxes()
Dim cb As CheckBox
For Each cb In ActiveSheet.CheckBoxes
cb.Value = False
Next cb
End Sub


but every time i click my 'clear' autoshape, it tells me no cells were found?
 
Upvote 0
My code wouldn't tell you anything either way, so it must be down to whatever else your shape is doing.
 
Upvote 0
Hi

well currently it clears a set range of boxes also on my form. is this why its having this problem? and how do i rectify? how is it linking to the box from that code ?
 
Upvote 0
Since I don't have the faintest idea what else is happening in the workbook, or how, I can't really say. Do you have other code attached to that shape or to the checkboxes?
 
Upvote 0
Hi

no other code attached to that shape , but the sheet itself, has code to make boxes mandatory and forward the form via e-mail. (however, this is attached to a command button and not to the same shape as the clearing of boxes)

Does that give to a better idea?
 
Upvote 0
Not really. ;)
I would have to assume you have some event code and your checkboxes are linked to cells - so when you clear the checkboxes, you alter the linked cells and the event code responds.
 
Upvote 0
Hi

no these check boxes are just visual indicators, they dont link to any information, they just allow selections.

i just want it so every time i hit 'clear' it clears the text boxes and check boxes and returns the form to original state.
 
Upvote 0
Then your 'Clear' shape should simply call whatever code it has now to clear the textboxes and then my code to clear the textboxes.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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