Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 259
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 259
Default Rounding up/down time

So Cool

Thank you so much Claus.

Mick.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rounding Time. GEM Excel Worksheet Functions 7 July 31st 08 03:48 PM
rounding time MEH Excel Worksheet Functions 3 February 26th 07 07:04 PM
Time rounding help Sanch Excel Discussion (Misc queries) 3 June 30th 06 06:37 PM
Rounding Time Tom Ogilvy Excel Programming 0 August 30th 04 05:57 PM
Rounding time RachDobs Excel Programming 4 January 29th 04 07:10 PM


All times are GMT +1. The time now is 06:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"