excel - 06:00 displays as 00:25 in userform -
i'm trying retrieve time information spreadsheet on userform, i'm coming across issue 06:00:00 displayed 00:25:00. spreadsheet used time calculations company flexi time , we're trying simplify , limit user interface using userform. changes 12:00:00 00:05:00. there way of getting display correct time?
this code using display info.
private sub timecheck_change() if left(timecheck.text, 1) = "-" timecheck.forecolor = rgb(255, 0, 0) end if timecheck.text = format(timecheck.text, "hh:nn;(hh:nn)") end sub
this ties textbox sheet:
private sub cmdsearch_click() row_number = 0 doevents row_number = row_number + 1 status = sheets("flex total").range("a" & row_number) if status = employeecheck.text timeowedcheck.value = sheets("flex total").range("b" & row_number) timetakencheck.value = sheets("flex total").range("c" & row_number) timecheck.value = sheets("flex total").range("d" & row_number) end if loop until status = "" end sub
in code, line assigns value spreadsheet:
timecheck.value = sheets("flex total").range("d" & row_number)
equivalent to:
timecheck.value = sheets("flex total").range("d" & row_number).value
the cell range
object, , default property .value
. property returned unless specify property instead. in case, value 0.25, changing numberformat
property not help.
instead, try:
timecheck.value = sheets("flex total").range("d" & row_number).text
this use cell's .text
property instead of .value
, , .text
property affected numberformat
change have made, think should fix it.
Comments
Post a Comment