Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calculating the current time in Excel 2007

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Calculating the current time in Excel 2007

On Jul 12, 10:13*am, wrote:
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Calculating the current time in Excel 2007


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





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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Calculating the current time in Excel 2007

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'
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
In Excel: is there a way of inserting the current time (what time it is right NOW) [email protected] Excel Discussion (Misc queries) 2 May 20th 07 11:35 PM
In Excel: is there a way of inserting the current time (what time it is right NOW) [email protected] Excel Programming 2 May 20th 07 11:35 PM
Having the current time inserted w/o updating the current time sherobot Excel Worksheet Functions 2 October 2nd 06 05:05 PM
Calculating Current Age from DOB Sonia Excel Worksheet Functions 3 April 27th 06 03:40 PM
Can I automatically enter the current date or current time into a Ben New Users to Excel 7 October 19th 05 03:38 PM


All times are GMT +1. The time now is 04:59 AM.

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

About Us

"It's about Microsoft Excel"