Time Value & Display

lstewart

New Member
Joined
Jan 28, 2014
Messages
47
Hi Everyone,
In Excel cell I have entered the time 13:00 and this is displayed in the cell correctly. However, I can see the cell value in the display bar is 13:00:00. I need both to display 13:00. I have tried format cell > time > custom and select hh:mm but nothing changes.
Thank you for your help.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
The format of the bar can not be changed.

edit:-

Actually, that's not entirely true. You can format the cell as text, but it will most likely break any formulas that need to work with your times.
 
Upvote 0
Changing the format of the cell, just changes how the value is displayed, it does not change the value.
If you want to keep it as a Time value then the formula bar will show hh:mm:ss
 
Upvote 0
If I change for cell format to text, it displays 0.541666667. I don't need to keep the time format and I'm not using any formulas. I need the value and display to be 13:00
 
Upvote 0
You are wanting the impossible, what I suggested was a very crude workaround which will show do what you want, but will cause more problems than it is worth. No experienced excel user would even consider attempting it.

Specifically why do you 'need' to change what is shown in the formula bar?
 
Upvote 0
I'm importing this data into another piece of software. When the import is complete the other software shows 13:00:00 the same as the value. I need everything to display as 13:00. I'm not using any formulas, I don't even need it to be a time format.
 
Upvote 0
In that case just set the cell to Text & then insert 13:00
 
Upvote 0
In that case the text format shouldn't be an issue, but any existing records will be converted to time serial (the number that you saw earlier).

To convert your existing data, select all of the cells that contain times then run the code below. Please create a backup copy of your file before testing the code.
VBA Code:
Sub TimeToText()
Dim c As Range
For Each c In Selection
    c.NumberFormat = "@"
    c.Value = Format(c.Value, "hh:mm")
Next
End Sub
 
Upvote 0
Thank you all. I have over 300 rows that need changing to text then retyping, so I was looking for an easy way. Thank you again, much appreciated.
 
Upvote 0
That's what Jason's code will do. :)
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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