ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rounding up/down time (https://www.excelbanter.com/excel-programming/444692-rounding-up-down-time.html)

Vacuum Sealed

Rounding up/down time
 
Hi All

As the subject suggests, more importantly, is it possible.

I use the following as a Time Stamp.

Sub TimeStamp()
ActiveCell.NumberFormat = "hh:mm"
ActiveCell.Value = Now()
End Sub

I need assistance for the correct Syntax Structure to incorporate the
MINUTE() Formula to work inside the above routine so that when the user hits
the time stamp it stamps the time to the closest 5 minutes.

eg

If it is 15:41, it would stamp 15:40, conversely, 16:44 = 16:45..

Appreciate your help

TIA
Mick.



Claus Busch

Rounding up/down time
 
Hi Mick,

Am Tue, 21 Jun 2011 20:59:05 +1000 schrieb Vacuum Sealed:

I need assistance for the correct Syntax Structure to incorporate the
MINUTE() Formula to work inside the above routine so that when the user hits
the time stamp it stamps the time to the closest 5 minutes.


try this:
ActiveCell = Round(Time * 288, 0) / 288


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Vacuum Sealed

Rounding up/down time
 
So Cool

Thank you so much Claus.

Mick.




All times are GMT +1. The time now is 12:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com