View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default working with cells and text

Job,

Select the cells with the times, and run the macro below.

HTH,
Bernie
MS Excel MVP

Sub test()
Dim mycell As Range
For Each mycell In Selection
mycell.Value = "'" & Format(mycell.Value, "h:mm")
Next mycell
End Sub


"Job" wrote in message ...
I have a number of cells that have duration of time values, i.e 6:30,5:28; which are hours and
minutes. I actually want these values but in text format. They would look identical but wouldn't
have the Date/Time stamp on them. What I have done in the past is copy the column of data and
paste into notepad, then made the column a text format then pasted back from notepad into Excel.
This gives the desired result, however, there has to be a better way of doing this via code or
something.

Any help is appreciated.