Calculating the current time in Excel 2007

  • Thread starter Thread starter peter_maw
  • Start date Start date
P

peter_maw

Hi Everyone,

And thanks in advance for any replies.

Like most people, I have lots of problems calculating times in Excel.
And this time, I'm completely stuck!!!

I'll try and explain this as precisely as possible so everyone
understands. I'm sure others will also appreciate the answer.


I need to put the current time in a cell. This must be updated on each
refresh.

In a second cell, I need to calculate the current time plus a time
that I set. For instance, CurrentTime+ 40 seconds.
The idea is to use this final value in a VBA procedure, if that's any
help.


Many Thanks,




Herbie
 
Hi Everyone,

And thanks in advance for any replies.

Like most people, I have lots of problems calculating times in Excel.
And this time, I'm completely stuck!!!

I'll try and explain this as precisely as possible so everyone
understands. I'm sure others will also appreciate the answer.

I need to put the current time in a cell. This must be updated on each
refresh.

In a second cell, I need to calculate the current time plus a time
that I set. For instance, CurrentTime+ 40 seconds.
The idea is to use this final value in a VBA procedure, if that's any
help.

Many Thanks,

Herbie

The following puts the time in the active cell and 40 seconds later in
the adjacent cell:

Sub timeIt()
With ActiveCell
.Value = Now - Int(Now)
.Offset(0, 1).Value = .Value + TimeValue("00:00:40")
.Offset(0, 1).NumberFormat = "[$-F400]h:mm:ss AM/PM"
End With
End Sub
 
In A5 enter "40"
In B5 enter "=Now()"
In C5 enter "=B5+A5/86400)

Format B5 and C5 with an appropriate "Time" custom number format.
(possibly: "h:mm:ss AM/PM")

--
Jim Cone
Portland, Oregon USA
"thanks in advance means no thanks"
http://www.contextures.com/excel-sort-addin.html




<[email protected]>
wrote in message
Hi Everyone,

And thanks in advance for any replies.

Like most people, I have lots of problems calculating times in Excel.
And this time, I'm completely stuck!!!

I'll try and explain this as precisely as possible so everyone
understands. I'm sure others will also appreciate the answer.


I need to put the current time in a cell. This must be updated on each
refresh.

In a second cell, I need to calculate the current time plus a time
that I set. For instance, CurrentTime+ 40 seconds.
The idea is to use this final value in a VBA procedure, if that's any
help.


Many Thanks,




Herbie
 
Hi Peter,

In A1 enter 'Current tme:'
In B1 enter '=Now()'
In A3 enter 'Hours:'
In B3 enter '0'
In A4 enter 'Minutes'
In B4 enter '0'
In A5 enter 'Seconds'
In B5 enter '40'
In A6 enter 'Time Gap'
In B6 enter '=Time(B3,B4,B5)'
In A8 enter 'End time:'
In B8 enter '=B1+B6'

For B1, B6 and B8 set the numberformat to '"[$-F400]h:mm:ss'
 
Back
Top