See the attached sample file for implementation of the following:
The easiest way in Windows is to:
a. Deleted
b. Deleted
c. Create an ordinary Code Module:
ALT F11 (for VBA) > CTRL R > Right Click ThisWorkbook > Insert > Module
d. Move your Sub to the new code Module and make it Public in the new code module and even change the name.
In ordinary code module Module1:
e. Assign the Macro to the CheckBox
Right Click on the CheckBox > Assign Macro > Select CheckBoxEventHandler
It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
This option requires all variables to be declared and will give a compiler error for undeclared variables.
Lewis
Bookmarks