Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
KFC / A&W Boy
 
Posts: n/a
Default Clear cell contents with a button

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 as I use this email
more than the MSN email
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

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)


"KFC / A&W Boy" <KFC / A&W wrote in message
...
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
as I use this email
more than the MSN email



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use the contents of a cell to satisfy the result_vector arg. robh_2 Excel Worksheet Functions 3 February 24th 05 09:14 PM
Adding contents of one cell to a range of cells. CLJinVA Excel Worksheet Functions 1 February 10th 05 11:19 PM
Cell contents vs. Formula contents Sarah Excel Discussion (Misc queries) 3 December 15th 04 07:02 PM
Display actual contents of cell xmasbob Excel Discussion (Misc queries) 1 December 6th 04 06:09 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 08:16 PM


All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"