Excel Timesheet

trigirl

Board Regular
Joined
Sep 13, 2007
Messages
87
I have an Excel timesheet, and I am wondering if there is a way to have the timesheet default to PM after 12 noon, so the employees dont have to put in PM, they would just put their time and the sheet would default it to PM.
 
just stick the password for the sheet in brackets after the command as in below.

Andy

activesheet.protect (password)

activesheet.unprotect (password)
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I put in the password and now I am getting an error saying I have the wrong password, but it is correct, I can enter it manually and it works fine.
Here is the code I am using:

Sub Button3_Click()
ActiveSheet.Unprotect (rw4455)
InpBx1 = InputBox("Enter the hour you want.")
InpBx2 = InputBox("enter the minutes you want.")
InPBx3 = InputBox("Enter AM or PM ")
Application.ActiveCell.Value = InpBx1 & ":" & InpBx2 & ":" & "00 " & InPBx3
ActiveSheet.Protect (rw4455)
End Sub
 
Upvote 0
yeah for some reason it doesn't recognise that the passwords are the same(no idea why). the way to get around it is don't protect the sheet in the normal way. Instead protect in in the workbook open event as in below, it then recognises it and should be fine.

Andy

Code:
Private Sub Workbook_Open()

sheets("your sheet name").protect (rw4455)

End sub
 
Upvote 0
Is there a way I can also add a prompt that says: Did you check to make sure you entered time correctly? and then they have to click yes to proceed.
I would like this to show once the time they entered is recorded on the sheet form the script above.
 
Upvote 0
Do you enter time to the minute? Or every 5 minutes? Or Quarter hour?

The reason I ask, is you could create a combo box with the times in it and then there is no doubt the time would be correct.

michael
 
Upvote 0
We enter time down to the min, so this would be too much for a combo box. I created a Validation that would prompt this, but it does not work when using this script, maybe there is a way to write it into the script.
 
Upvote 0
How about a USER FORM?
That has a combo box that has 1-12 for the hours.
Another that has 1-59 minutes and
a check box for am/pm
Then an OK button to enter the time into the active Cell?

Michael
 
Upvote 0
Well the script we are using kinda of does this now and they can still select the wrong one (AM/PM), so I would really just like to go with a reminder. Plus the fact that I just got everyone trained to use the pop-up box in the script.
 
Upvote 0

Forum statistics

Threads
1,215,944
Messages
6,127,835
Members
449,411
Latest member
adunn_23

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