Please help quickly

Bohica

New Member
Joined
Jul 24, 2006
Messages
3
Hi all,

I have a problem with my timesheet. I need it to round up and down in 15 minute increments. I have been able to create it using this message board (yes I just borrowed your brilliance) and I'm sure there's an easy way to do this but since I don't understand it I can't fix it. I have borrowed a vb code to get me started and in each cell there is a formula to enter and calculate the time automatically by double clicking. So here you go and btw Thanks.

This is the code I borrowed:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Count > 1 Then Exit Sub
If Target.Row < 7 Or Target.Row > 12 Then Exit Sub
If Target.Column < 3 Or Target.Column > 6 Then Exit Sub
ActiveSheet.Unprotect "password"
Application.EnableEvents = False
Target.Value = Time
ActiveSheet.Protect "password"
Application.EnableEvents = True


End Sub

Each cell in the daily total column is the following:

=((F7-C7+(F7<C7))-(E7-D7+(E7<D7)))*24

In the weekly total column the formula is basic:

=SUM(G7:H11)

All of which work awesome!!! Except for the 15 minutes rounding.

Thank you, Please help quickly.
Bohica :)
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Greg Truby

MrExcel MVP
Joined
Jun 19, 2002
Messages
10,022
If yer in such a toot fer an answers, ya might try doin' a search! :wink:

The very first thread returned by search for "round times 15 minutes" returned this:

http://www.mrexcel.com/board2/viewtopic.php?p=1110315#1110315

from Denis (SydneyGeek) which you should be able to apply to your code. (At least give it a shot before you ask someone else to try.)

<sup>edit</sup> Mr. Poulsom, you are so much nicer than me! (And obviously a quicker typist!) <sub>/edit</sub>
 
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,167,464
Messages
5,853,901
Members
431,602
Latest member
myuzejuk

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