Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Calculating Hours from Textbox Times

Private Sub TextBox9_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox8 < "" And TextBox9 < "" Then Label63 = (TextBox9.Value -
TextBox8.Value) * 24
End Sub

With the above line of code, i am trying to gain the value in Hours between
the 2 textboxes, but i get an error.

Textbox8.value = 3:30PM
Textbox8.value = 7:30AM

??



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Calculating Hours from Textbox Times

Private Sub TextBox9_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox8.Text < "" And TextBox9.Text < "" Then _
Label63.Caption = (TimeValue(TextBox9.Value) - _
TimeValue(TextBox8.Value)) * 24
End Sub



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Corey ...." wrote in message
...
Private Sub TextBox9_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox8 < "" And TextBox9 < "" Then Label63 = (TextBox9.Value -
TextBox8.Value) * 24
End Sub

With the above line of code, i am trying to gain the value in Hours
between the 2 textboxes, but i get an error.

Textbox8.value = 3:30PM
Textbox8.value = 7:30AM

??





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Calculating Hours from Textbox Times

Thank you BOB.

Perfect !!

"Bob Phillips" wrote in message
...
Private Sub TextBox9_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox8.Text < "" And TextBox9.Text < "" Then _
Label63.Caption = (TimeValue(TextBox9.Value) - _
TimeValue(TextBox8.Value)) * 24
End Sub



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Corey ...." wrote in message
...
Private Sub TextBox9_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox8 < "" And TextBox9 < "" Then Label63 = (TextBox9.Value -
TextBox8.Value) * 24
End Sub

With the above line of code, i am trying to gain the value in Hours
between the 2 textboxes, but i get an error.

Textbox8.value = 3:30PM
Textbox8.value = 7:30AM

??







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
Hours between to two times Dave08 Excel Worksheet Functions 3 October 16th 08 01:14 AM
Displaying calculated times - half-hours are not calculating... jacob Excel Worksheet Functions 1 June 1st 07 04:03 PM
calculating times (hours and miniutes) on a time sheet madtech Excel Worksheet Functions 2 June 30th 06 07:40 PM
Calculation of hourly rate times hours times 1.5 Newbusinessbod Excel Worksheet Functions 1 December 6th 05 04:44 PM
=Text(b2-A2,"h") hours between 2 times, what do I do for 10 times Jayda New Users to Excel 3 May 18th 05 05:53 PM


All times are GMT +1. The time now is 01:58 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"