Copy the below code and do right click on sheet tab and select view code and paste it.
Close the VBA window (Alt+Q to close VBA window) and return to that sheet and check.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim sFormula As String
If Target.Address <> "$A$1" Then Exit Sub
Application.EnableEvents = False
With Target
sFormula = "=IFERROR(SUM(LEFT(""" & .Value & """,FIND(""-"",""" & .Value _
& """)-1)*14,MID(""" & .Value & """,FIND(""-"",""" & .Value & """)+1,255)),""-"")"
.Value = Evaluate(sFormula)
End With
Application.EnableEvents = True
End Sub
Enter the value in A1 Cell and check....
Ensure that your entry should start with a single quote ( ' ) so that the numeric entry will be considered as text otherwise excel will convert the entry to real date.
I restricted the conversion to happen in A1 cell alone.
Bookmarks