Rounding up/down time

V

Vacuum Sealed

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.
 
C

Claus Busch

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top