
Signature
Newbies need extra loven.........
This will get you going.
Now, just so you know, this doesn't recalculate for minutes more then 60,
and convert it to hours, then remaining minutes.
Just play with the numbers in your two input textboxes and you will see what
i mean.
--------------------------------------------
Private Sub txtRunMinutes_Change()
Dim sHours As String
sHours = (Me.txtMinutesWorked.Text - Me.txtRunMinutes.Text) / 60
Dim sHours2 As String
sHours2 = FormatNumber(Me.txtMinutesWorked.Text, 0)
Dim sMinutes As String
sMinutes = Me.txtMinutesWorked.Text
Dim sMinutes2 As String
sMinutes2 = FormatNumber(Me.txtRunMinutes.Text, 0)
Dim sTotalMinutes As String
sTotalMinutes = sHours2 - sMinutes2
Me.txtDelayMinutes.Text = sTotalMinutes
Dim sTotalHours As String
sTotalHours = FormatNumber(sHours, 0) & "h "
Dim sTotalMinutes2 As String
sTotalMinutes2 = sTotalMinutes -
FormatNumber(Me.txtRunMinutes.Text, 0)
Dim sLessMinutes As String
sLessMinutes = sTotalHours & sTotalMinutes2 & "m"
Me.txtDelayHours.Text = sLessMinutes
Me.txtDelayInDecimal.Text = FormatNumber(sHours, 1)
End Sub
------------------------------------------------
There is always a better, more streamlined way of doing it, but i just blew
it out to give you a quick answer.
Hope this helps.
> Hello, I have a form in my excel workbook that is brought up by a buttons on
> click event. On this form I have 5 text boxes.
[quoted text clipped - 12 lines]
>
> Thanks!