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 [email protected] 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)
 
Top