There are a couple of ways to do this
Using a checkbox from the controls tool bar:
place the checkbox on the sheet and double click on it, this takes you to the code window, paste this code there
the msgbox code is where your macro would be
Using the forms tool bar place the check box on the sheet, right click on the checkbox and select format control
select the cell link C9 for this example
Click anywhere outside the checkbox then
right click on the check box again and
select assign macro, then click new
paste this code there
The text in blue goes between the check box name and end sub
Bookmarks