PC Review


Reply
Thread Tools Rate Thread

Calculating Hours from Textbox Times

 
 
Corey ....
Guest
Posts: n/a
 
      7th Jul 2008
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 With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      7th Jul 2008
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 ...." <(E-Mail Removed)> wrote in message
news:eJtWDb$(E-Mail Removed)...
> 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 With Quote
 
Corey ....
Guest
Posts: n/a
 
      7th Jul 2008
Thank you BOB.

Perfect !!

"Bob Phillips" <(E-Mail Removed)> wrote in message
news:er%(E-Mail Removed)...
> 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 ...." <(E-Mail Removed)> wrote in message
> news:eJtWDb$(E-Mail Removed)...
>> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 Calculating hours between two dates/times Pls HELP!!! Quanda General Software 1 22nd Jun 2009 03:16 PM
Calculating number of hours between 2 start and finish times on su Ammo Microsoft Access Form Coding 5 8th Aug 2008 05:21 PM
Displaying calculated times - half-hours are not calculating... jacob Microsoft Excel Worksheet Functions 1 1st Jun 2007 04:03 PM
calculating times (hours and miniutes) on a time sheet =?Utf-8?B?bWFkdGVjaA==?= Microsoft Excel Worksheet Functions 2 30th Jun 2006 07:40 PM
Calculating elapsed time in hours:minutes (minus weekends [48 hours]) bigjess007 Microsoft Excel Worksheet Functions 2 20th Jul 2004 08:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:51 AM.