PDA

View Full Version : Find 2 identical values in 2 columns - looking for error message



Dlink10
07-17-2014, 07:05 AM
I have a userform and table here that records when an employee signs in and out of work.

Everything works fine except i'm looking for a way to prevent employees to sign in twice on the same day, and an error message box that alerts the user when this occurs.

I'm trying to use countifs but I can't seem to incorporate it into the code.

Can anyone help?

werafa
07-17-2014, 03:46 PM
In the excel sheet, why don't you add a sheet/table for current day.
then record the start date and time, then the end date and time when they log out.

logging out can then trigger a calculation of hours worked and fill the rest of your tables, and reset the 'current day' table for the next day.
If a user logs out, and then logs back in, you can simply delete the old log-out info and recalculate new values when final log-out is enetered.

I didn't check the code thoroughly, but do you trigger a workbook close or open event to find/fix any details where someone forgot to log out?