Forum Discussion

WABlok's avatar
WABlok
Copper Contributor
Jan 15, 2023
Solved

Simple time input

Hello everyone,

I'm looking for an easier way to enter times in excel.
for example, if I enter 1000 it should be processed automatically to 10:00.
So I want to skip the step that I have to enter the : myself, saves me so many actions to go from my numpad to the shift + ;.
Who can help me on how to get this done, thanks in advance.

  • WABlok 

    See the attached version. It is now a macro-enabled workbook; you'll have to allow macros when you open it.

    If you want to inspect the code, right-click the sheet tab and select 'Code weergeven' from the context menu.

15 Replies

  • WABlok 

    You would need a VBA event handler for that.  Excel, being a functional programming environment, is specifically designed to disallow such changes of state resulting from formulae.

  • Hi WABlok 

     

    Just to make sure I understand you well, you need to convert the number to time like

    1000 --> 10:00

    1250  --> 12:50

    130 --> 01:30

     

    once you enter your numbers in column A write this formula in column B

    =CONCAT(IF(LEN(TRIM(A1))>3,LEFT(A1,2),CONCAT(0,LEFT(A1,1))),":",RIGHT(A1,2))

    • WABlok's avatar
      WABlok
      Copper Contributor

      that's what i want, but in the same cell.

      Do I write it in cell A1 and hit enter the right outcome must be a time with : in it

      • WABlok 

        The link that I posted in my previous reply provides the code that you need to convert 1045 to 10:45 in the cell itself.

Resources