Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help calculate time


Hi,
i'm a newbie...
i need some help on how to calculate *time* and display it i
textbox3.

user inputs time start in textbox1 and
user inputs time finished in textbox2

textbox3 = textbox2 - textbox1

how do i code it using vbscript?

thanks so much

--
kenrose0
-----------------------------------------------------------------------
kenrose08's Profile: http://www.excelforum.com/member.php...fo&userid=2231
View this thread: http://www.excelforum.com/showthread.php?threadid=56689

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default help calculate time

Take a look here at Chip's pages.

http://www.cpearson.com/excel/datetime.htm#AddingTimes

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"kenrose08" wrote:
|
| Hi,
| i'm a newbie...
| i need some help on how to calculate *time* and display it in
| textbox3.
|
| user inputs time start in textbox1 and
| user inputs time finished in textbox2
|
| textbox3 = textbox2 - textbox1
|
| how do i code it using vbscript?
|
| thanks so much!
|
|
| --
| kenrose08
| ------------------------------------------------------------------------
| kenrose08's Profile:
http://www.excelforum.com/member.php...o&userid=22317
| View this thread: http://www.excelforum.com/showthread...hreadid=566891
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help calculate time


Hello kenrose08,

This maybe more what you are looking for in VBA.

Mytime = TimeValue(TextBox2.Text) - TimeValue(TextBox3.Text)

'24 Hour Format
TextBox3.Text = Format(Mytime, "hh:mm")

'AM PM format
TextBox3.Text = Format(MyTime, "hh:mm AM/PM")

If you need the seconds change "hh:mm" to "hh:mm:ss".

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=566891

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help calculate time


thank you so much!!!

Leith Ross Wrote:
Hello kenrose08,

This maybe more what you are looking for in VBA.

Mytime = TimeValue(TextBox2.Text) - TimeValue(TextBox3.Text)

'24 Hour Format
TextBox3.Text = Format(Mytime, "hh:mm")

'AM PM format
TextBox3.Text = Format(MyTime, "hh:mm AM/PM")

If you need the seconds change "hh:mm" to "hh:mm:ss".

Sincerely,
Leith Ross



--
kenrose08
------------------------------------------------------------------------
kenrose08's Profile: http://www.excelforum.com/member.php...o&userid=22317
View this thread: http://www.excelforum.com/showthread...hreadid=566891

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help calculate time


thanks! i'll keep it for future reference...
Dave Patrick Wrote:
Take a look here at Chip's pages.

http://www.cpearson.com/excel/datetime.htm#AddingTimes

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"kenrose08" wrote:
|
| Hi,
| i'm a newbie...
| i need some help on how to calculate *time* and display it in
| textbox3.
|
| user inputs time start in textbox1 and
| user inputs time finished in textbox2
|
| textbox3 = textbox2 - textbox1
|
| how do i code it using vbscript?
|
| thanks so much!
|
|
| --
| kenrose08
|
------------------------------------------------------------------------
| kenrose08's Profile:
http://www.excelforum.com/member.php...o&userid=22317
| View this thread:
http://www.excelforum.com/showthread...hreadid=566891
|



--
kenrose08
------------------------------------------------------------------------
kenrose08's Profile: http://www.excelforum.com/member.php...o&userid=22317
View this thread: http://www.excelforum.com/showthread...hreadid=566891

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
Excel 2007 calculate time between 2 date/time columns Kevo Excel Discussion (Misc queries) 8 April 25th 09 12:02 AM
Calculate the duration between the end time and start time of anot Rusty Excel Worksheet Functions 4 May 27th 08 06:28 AM
Calculate Ending time using Start Time and Elapsed Time Chief 711 Excel Worksheet Functions 5 May 13th 08 04:34 PM
IF statement to calculate time usage in specific time bands Daren Excel Worksheet Functions 6 January 31st 07 01:34 PM
how to calculate time start & time finish in quarter hour Peter Wu Excel Discussion (Misc queries) 3 June 7th 06 12:58 AM


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

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"