How do I clear Cell B5 only when A tick box is ticked that I created?
How do I clear Cell B5 only when A tick box is ticked that I created?
I assume you're using a Checkbox control from the ActiveX objects (Developer Ribbon > Controls > Insert > ActiveX). If so, in Design Mode double-click the checkbox to open the code editor for that object and add the following code:
Close the VBA Editor and take the checkbox out of Design Mode (on the Developer ribbon).![]()
Please Login or Register to view this content.
This will do exactly what you said, even if you unintentionally check the box. If you subsequently un-check it, nothing happens. (e.g. It doesn't undo the previous action.) If the checkbox is already checked, and you un-check it, that will also clear cell B5 since this code simply pertains to the click event. Additional code can be used to determine what to do when the checkbox is checked vs. unchecked, or prompt you for confirmation, etc.
can I simply put that Private Sub into my Sub?
If you already have code for the checkbox in question, sure. Just add the actual line of code (middle), not the Private Sub or End Sub lines.
If I only enter
in my sub with other content it will always clear, how do I only clear when that box is ticked?![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks