Results 1 to 5 of 5

need to convert time to minutes in userform

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-08-2006
    Posts
    203

    need to convert time to minutes in userform

    I know how to do this in a worksheet:

    =(b1-a1)*1440

    B1 being the end time and A1 being the start time

    I have a userform where the start time and end time are entered in text boxes

    txtstart1 and txtend1

    I would like the result to show up in txtmin1

    Here is my code that doesnt work. I tried to convert code from a non-time sheet of mine. Dim as Integer may be the problem, I just learn as I go, and so far have only dealt with Integers.

    Private Sub txtend1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    
    Dim endnum1 As Integer, startnum1 As Integer
    
        With frmquota
        
        If txtend1.Value = "" Then
            endnum1 = 0
        Else
            endnum1 = txtend1.Value
        End If
        
            If txtstart1.Value = "" Then
            startnum1 = 0
        Else
            startnum1 = txtstart1.Value
        End If
        
        txtmin1.Value = endnum1 - startnum1 * 1440
        
        End With
        
    End Sub
    Thank you for any help
    Last edited by iturnrocks; 07-14-2009 at 01:59 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1