Free for PREMIUM members
[Webinar] Streamline your web hosting managementRegister Today
Private Sub Command8_Click()
Me.Text4 = FormatHourMinute(fComputeTime())
Private Sub Form_Load()
Me.Text1 = "18 hours 10 minutes"
Me.Text2 = "1 hour 10 minutes"
Me.Text3 = "18 hours 1 minute"
Private Function fComputeTime() As Date
Dim ctl As Control
Dim datTime As Date
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
If InStr(ctl.Value, "hour") > 0 And InStr(ctl.Value, "minute") > 0 Then
datTime = datTime + TimeSerial(CLng(Split(ctl.Value, " ")(0)), CLng(Split(ctl.Value, " ")(2)), 0)
fComputeTime = datTime
Public Function FormatHourMinute( _
ByVal datTime As Date, _
Optional ByVal strSeparator As String = ":") _
' Returns count of days, hours and minutes of datTime
' converted to hours and minutes as a formatted string
' with an optional choice of time separator.
' datTime: #10:03# + #20:01#
' returns: 30:04
' 2005-02-05. Cactus Data ApS, CPH.
Dim strHour As String
Dim strMinute As String
Dim strHourMinute As String
strHour = CStr(Fix(datTime) * 24 + Hour(datTime))
' Add leading zero to minute count when needed.
strMinute = Right("0" & CStr(Minute(datTime)), 2)
strHourMinute = strHour & strSeparator & strMinute
FormatHourMinute = strHourMinute
Open in new window
With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $31.20.
Premium members get this course for $18.75.
Premium members get this course for $159.20.
Premium members get this course for $95.20.
Premium members get this course for $174.99.
Premium members get this course for $79.20.
Premium members get this course for $99.99.