Good Morning
i have got a user form whereby it inputs the total number of days between the two dates selected from a calendar, however, i would like to convert this into the hours instead of the total days
i have got a user form whereby it inputs the total number of days between the two dates selected from a calendar, however, i would like to convert this into the hours instead of the total days
VBA Code:
Sub Calculate_Days()
Me.TextBox7 = ""
If Me.TextBox2.Value <> "" And Me.TextBox3.Value <> "" Then 'textbox2 is the start date & textbox3 is the end date (end date is always greater than the start date
If CDate(Me.TextBox3.Value) >= CDate(Me.TextBox2.Value) Then
If Me.ComboBox2.Value = "HD" Then
Me.TextBox7 = Format((CDate(Me.TextBox3.Value) - CDate(Me.TextBox2.Value) + 1) / 2, "0.0") 'Shows number of days in textbox7
Else
Me.TextBox7 = Format(CDate(Me.TextBox3.Value) - CDate(Me.TextBox2.Value) + 1, "0")
Me.TextBox8 = Me.TextBox6.Value - Me.TextBox7.Value 'textbox8 minus the total number of days from textbox7
End If
End If
End If
End Sub