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 you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
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
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,865
Members
449,052
Latest member
Fuddy_Duddy

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
Back
Top