Sub convert()
Dim rng As Range, cell As Range, x As String
Set rng = Range("K2:K625")
For Each cell In rng
If (cell.Value <> "") Then
cell.NumberFormat = "h:mm:ss"
cell.Value = TimeValue((Left(cell.Value, 2) & ":" & Mid(cell.Value, 4, 2) & ":" & Right(cell.Value, 2)))
cell.Formula = "=TEXT(" & cell.Value & ",""HH:MM AM/PM"")"
cell.Copy
cell.PasteSpecial xlPasteValues
Application.CutCopyMode = False
End If
Next cell
End Sub
|