Hi,
I made a simple time reporting tool for a coworker. Every line of code that has to do with time includes formatting, example: Range().Value = Format(a_time_variant, "h:mm")
I have a button "Start new task" executing a macro, which will set default values for a userform, then opens the form.
In this form, modifiable textbox1.text will become the starting time of the task. I'll simplify a little but let's say this value is always Format(Time(), "h:mm") as default.
When I open the form it shows exactly as it supposed to, and everything works fine. He's tried it with multiple computers and it worked fine.
However:
He now reported that when he clicks the button and form opens, Textbox1.text is in format: "h.mm"
Now I don't understand how that is possible, even if the OS time format is different from mine, as all relevant form only operates with Format(… "h:mm")
A second problem is that when format(textbox1.text, "h:mm") is copied to the designated cells, it becomes 0:00 if it was for some reason in the above format, h.mm
Also, from what I understood from him, even if he types the time in h:mm to textbox1 it still copies as 0:00
Why does this happen? Is there a way to make it "h:mm" no matter what? Is there a workaround that will copy textbox1.text to format "h:mm" no matter what?
Here's the important pieces of code:
Button set default value for textbox1.text:
Form button copies the new task, puts textbox1.text as starting time
Bookmarks