Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've got a column of "Time" information that doesn't have a colon separating
the hours from the minutes. I'm looking for a macro to: move 2 places to the left insert ":" An example of the data are 0957 1412 1952 and I want 09:57 14:12 19:52 The data begin at B2. Thanks, Norm |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sure you need a macro? You could try this formula:
=--TEXT(A1,"00\:00") Or, with a macro: Public Sub SelectionToTime() Dim rCell As Range For Each rCell In Selection.Cells With rCell If .Text Like "####" Then .Value = TimeValue(Format(.Text, "00\:00")) .NumberFormat = "[hh]:mm" End If End With Next rCell End Sub In article , Norm Shea wrote: I've got a column of "Time" information that doesn't have a colon separating the hours from the minutes. I'm looking for a macro to: move 2 places to the left insert ":" An example of the data are 0957 1412 1952 and I want 09:57 14:12 19:52 The data begin at B2. Thanks, Norm |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
JE,
You are right, I don't need a macro. Worked wonderfully! Where are all these formulas hidden?! I am always amazed (and appreciative) at how quickly and effectively questions are responded to. Thanks, Norm "JE McGimpsey" wrote: Sure you need a macro? You could try this formula: =--TEXT(A1,"00\:00") Or, with a macro: Public Sub SelectionToTime() Dim rCell As Range For Each rCell In Selection.Cells With rCell If .Text Like "####" Then .Value = TimeValue(Format(.Text, "00\:00")) .NumberFormat = "[hh]:mm" End If End With Next rCell End Sub In article , Norm Shea wrote: I've got a column of "Time" information that doesn't have a colon separating the hours from the minutes. I'm looking for a macro to: move 2 places to the left insert ":" An example of the data are 0957 1412 1952 and I want 09:57 14:12 19:52 The data begin at B2. Thanks, Norm |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Diff. change headline in "Formatting" or "Outlining" toolbar? | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running | Excel Programming | |||
macro for converting number stored as "text" (or preceeded with ') to "number" formatting | Excel Programming | |||
macro for converting number stored as "text" (or preceeded with ') to "number" formatting | Excel Programming |