Keep people from changing time in and time out

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
I have an old computer at work. We are going to use it as our time clock. I want them to enter their time in and out themselves. However, once they entered their time, I don't want them to be able to change it. Is there something I can do to prevent this? If so, I would need a manager to be able to edit it as needed.

Any ideas?

Thank You,
Michael
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hello, Michael,

can you start with something like this ?
Code:
Option Explicit

Dim flag As Boolean

Private Sub Worksheet_Change(ByVal Target As Range)
'Erik Van Geit
'051124
'freeze entries
If flag = True Then Exit Sub
If Target.Count > 1 Then GoTo skip
If MsgBox("do you confirm this entry ?" & Chr(10) & Format(Target, "hh:mm:ss"), 292, "PLEASE CONFIRM") = vbNo Then GoTo skip
    
    Me.Unprotect "password"
    Target.Locked = True
    Me.Protect "password"

Exit Sub
skip:
flag = True
Application.Undo
flag = False
End Sub
TO INSTALL IN SHEET CODE WINDOW:
1. right click the "Name Tab" of sheet you want code to work in
2. Select "View Code" in drop down menu
3. VBE window will open ... paste code in and exit VBE

all entry cells must be unlocked to start and will be "frozen" one by one

kind regards,
Erik
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,502
Messages
5,832,099
Members
430,111
Latest member
Francis Xavier

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top