Clear cell contents with a button

K

KFC / A&W Boy

I have a hour calculator that I got oddly from Microsoft. What I am trying to
do is create a button that clears the two clock in fields and the two clock
out fields but leaves the formatting intact while in a protected sheet mode.
Can anyone help me? Please reply to (e-mail address removed) as I use this email
more than the MSN email
 
B

Bob Phillips

Just add this type of macro to the button

Sub ClearCells()
ActiveSheet.Unprotect Password:="Bob"
Range("A1").Value = ""
Range("A2").Value = ""
Range("B1").Value = ""
Range("B2").Value = ""
ActiveSheet.Protect Password:="Bob", DrawingObjects:=True,
Contents:=True, Scenarios:=True
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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