timesheet event handler

davejoy

New Member
Joined
Sep 27, 2013
Messages
2
I want to install a Workbook_SheetSelectionChange Event to simplify my timesheet.

When I click on a new time cell (triggering the event handler), I can sign in or out. At that point I want to be able to enter a 1-4 digits (no colon) so the program outputs the right time with a colon and MINUTES rounded up to the next 1/4-hour (i.e., "9" becomes "9:00"; "913 becomes "9:15", etc.).

Examples for 1-4 digit entries:
9 = 9:00 AM
12 = 12:00 PM
913 = 9:15 AM
1219 = 12:30 PM



Thanks!!!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Welcome to the Board!

I think you'd probably want to use the Before_DoubleClick event instead to prevent errant changes.

As for the rounding part you could try something like this:

Target.Value = Format(Round(Target.Value * 96, 0) / 96, "hh:mm AM/PM")

HTH,
 
Upvote 0
thanx 4 that...
won't be double-clicking a cell, so the workbook_sheetchange event is still apropos...
rounding idea should fix that part...
DJ

___________________________
"Life has a hidden IF inside."
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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