PDA

View Full Version : Solved: Understanding VBA minutes



Darren
09-10-2007, 02:52 AM
Hi Captains

This portion of the code was written by jonske.

Private Sub Workbook_Open()
Dim StartTime#, CurrentTime#

'*****************************************
'SET YOUR OWN TRIAL PERIOD BELOW
'Integers (1, 2, 3,...etc) = number of days use
'1/24 = 1Hr, 1/48 = 30Mins, 1/144 = 10Mins use


I would like to try and break down the 10 Min Use

If 1/144 is 10 Min

Would 1/244 be 5 min

1 Min = 1/ ?

Thanks for your help
Darren
South Africa

Bob Phillips
09-10-2007, 03:11 AM
There are 24 hours in a day, 60 minutes in an hour, so 1 minute is

1/24/60 or 1/1440

2 minutes are

1/1440*2 or 2/1440 or 1/720

5 minutes is

5/1440 or 1/288

etc.

Darren
09-10-2007, 03:16 AM
Hi Bob

Thanks for the prompt explanation.

Darren
South Africa

Bob Phillips
09-10-2007, 03:24 AM
Juts FYI, I tend to stick to the long style

1/24/60

and when I get to wseconds, I evene do

1/24/60/60

just helps to explain where the numbers come from to me.