time userform 12:00 changes in 00:05

J

joost

Hello,

I have the following problem.
In a userform i have a textbox with contain a time value.
if i fill in the time value 12:00 and save the time the time i correct given
in the excel sheets.
After loading the form again i get 00:05 for 12:00.

if i change the time to 12:01, the time value is correct. Even with 13:00 of
14:00 but not 12:00.
I use the following code:

TextBox6.Value = b6
TextBox6.Value = Format(Me.TextBox6.Value, "h:mm")

B6 is the cell value

can anyone help me

THanks
 
J

Joel

try adding a second h to the hour. also add date value. A text box is text
data, not a Serial Date (microsoft date format).

from
TextBox6.Value = Format(Me.TextBox6.Value, "h:mm")
to
TextBox6.Value = Format(datevalue(Me.TextBox6.Value), "hh:mm")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top