Format Cell for Time

Pascal

Board Regular
Joined
Jun 6, 2007
Messages
200
Hi,

I'd like to know if it's possible, I'm sure it is, to format a column so that when I enter time in to one of the cells I can just enter 0805 and it is then automatically formatted to 08:05.

I just want to do it to save a little time.

I've looked at formatting the cells as hh:mm, but upon entering 0805 it appears as 00:00 and 15/03/1902 00:00:00 when I click on the cell.

Even better would be if it allowed me to just enter 0805 and then displays it as 08:05, but has converted it to 31/07/2013 08:05.

Any ideas on how to achieve the auto formatting?

Many Thanks & Regards
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi,

Insert a module and paste the below code and use CONTROL + T. This code will enter the current time and convert them to values.

Hope this will help you.

Sub timeformat()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+t
'
ActiveCell.FormulaR1C1 = "=NOW()"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub

Thanks,
SK
 
Upvote 0
Hi,

Thanks for the reply, but I'm not sure how this helps?

I've carried out your steps, but when I enter 1308 into a Cell it just displays 1308.

How does this code format the Cell I've just entered my time into?

Regards
 
Upvote 0

Forum statistics

Threads
1,216,137
Messages
6,129,093
Members
449,486
Latest member
malcolmlyle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top