Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello friends,
I need to create time sheets for work.. So I have created a macro for entering the current time. But I do not want anyone to be able to change the time once it is entered in that column. And any time entered in the column should always be the current time Below is my macro for current time Private Sub cmd_time_Click() ActiveCell.Clear ActiveCell.FormulaR1C1 = "=NOW()" ActiveCell.Value = ActiveCell.Value End Sub What do I do? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub cmd_time_Click()
ActiveSheet.Unprotect Password:="theword" With ActiveCell .Value = Format(Now, "h:mm:ss AM/PM") .Locked = True .Columns.AutoFit End With ActiveSheet.Protect Password:="theword" End Sub I would first unlock all cells before protecting the sheet originally. Gord Dibben MS Excel MVP On Tue, 30 Sep 2008 13:41:01 -0700, Dominic wrote: Hello friends, I need to create time sheets for work.. So I have created a macro for entering the current time. But I do not want anyone to be able to change the time once it is entered in that column. And any time entered in the column should always be the current time Below is my macro for current time Private Sub cmd_time_Click() ActiveCell.Clear ActiveCell.FormulaR1C1 = "=NOW()" ActiveCell.Value = ActiveCell.Value End Sub What do I do? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
there is a sample timesheet workbook you can download for free at this site
which may give you some development pointers. http://spreadsheetpage.com/index.php/file/C35/P20/ -- jb "Dominic" wrote: Hello friends, I need to create time sheets for work.. So I have created a macro for entering the current time. But I do not want anyone to be able to change the time once it is entered in that column. And any time entered in the column should always be the current time Below is my macro for current time Private Sub cmd_time_Click() ActiveCell.Clear ActiveCell.FormulaR1C1 = "=NOW()" ActiveCell.Value = ActiveCell.Value End Sub What do I do? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Locking cell | Excel Discussion (Misc queries) | |||
locking only one cell | Excel Discussion (Misc queries) | |||
locking formula in cells in without locking whole sheet | Excel Discussion (Misc queries) | |||
Locking a cell | Excel Worksheet Functions | |||
cell locking via VBA | Excel Programming |