ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   time userform 12:00 changes in 00:05 (https://www.excelbanter.com/excel-programming/408575-time-userform-12-00-changes-00-05-a.html)

joost[_3_]

time userform 12:00 changes in 00:05
 
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



joel

time userform 12:00 changes in 00:05
 
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")


"joost" wrote:

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





All times are GMT +1. The time now is 07:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com