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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
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>
 
Upvote 0

Forum statistics

Threads
1,214,414
Messages
6,119,373
Members
448,888
Latest member
Arle8907

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