+ Reply to Thread
Results 1 to 2 of 2

Format(Time(), "h:mm") gives format h.mm

  1. #1
    Registered User
    Join Date
    11-14-2019
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    32

    Format(Time(), "h:mm") gives format h.mm

    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:
    Please Login or Register  to view this content.
    Form button copies the new task, puts textbox1.text as starting time
    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    11-14-2019
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    32

    Re: Format(Time(), "h:mm") gives format h.mm

    Just to add, he sent me the file back when he was having problems. I tried starting a new task and it worked perfectly. If I typed 0.14 it would become 0:00

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 07-13-2018, 11:52 PM
  2. [SOLVED] Converting "hh h mm m ss s" time format to "hh:mm:ss"
    By sohel.engr in forum Excel General
    Replies: 10
    Last Post: 09-28-2013, 03:15 PM
  3. [SOLVED] Remove "Time" from Date/Time format when importing from MS Query
    By auslegung in forum Excel General
    Replies: 5
    Last Post: 04-03-2013, 03:26 PM
  4. Replies: 2
    Last Post: 11-01-2012, 04:35 PM
  5. [SOLVED] Excel 2007 : Converting "mm min ss s" time format to "hh:mm:ss"
    By blackmilk in forum Excel General
    Replies: 15
    Last Post: 04-23-2012, 04:14 PM
  6. Replies: 4
    Last Post: 07-14-2010, 03:17 PM
  7. Extract "Time" from custom "Date and Time" format
    By ben_patto in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-24-2009, 08:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1