C
c mateland
Would someone help me understand this, please? In my user form, only
particular numbers format incorrectly into time with the following
code. (This is much simplified from the original, but still produces
the same problem.)
Private Sub UserForm_Initialize()
'This actually pulls in a variable from a cell, but shown with a
constant here.
TextBox1.Value = 0.25
'Later in the code, this formats the textbox to display time.
TextBox1.Value = Format(TextBox1.Value, "h:mm")
End Sub
It works with every number but .25 (6am) and .5 (noon). They format
incorrectly as "0:25" (12:25 am) and "0.05" (12:05 am), respectively.
All other numbers work, but I need it to work for these times as well.
???
Thanks,
Chuck
particular numbers format incorrectly into time with the following
code. (This is much simplified from the original, but still produces
the same problem.)
Private Sub UserForm_Initialize()
'This actually pulls in a variable from a cell, but shown with a
constant here.
TextBox1.Value = 0.25
'Later in the code, this formats the textbox to display time.
TextBox1.Value = Format(TextBox1.Value, "h:mm")
End Sub
It works with every number but .25 (6am) and .5 (noon). They format
incorrectly as "0:25" (12:25 am) and "0.05" (12:05 am), respectively.
All other numbers work, but I need it to work for these times as well.
???
Thanks,
Chuck