Sub InsertHypens()
Dim i As Long
Dim lastRow As Long
Dim tempValue As String
lastRow = Range("AC" & Rows.Count).End(xlUp).Row
For i = 2 To lastRow
tempValue = Cells(i, "AC").Value
If tempValue <> "" And Mid(tempValue, 3, 1) <> "-" Then
tempValue = Left(tempValue, 2) & "-" & Mid(tempValue, 3, 2) & "-" & Mid(tempValue, 5, 2) & "-" & Mid(tempValue, 7, 2) & "-" & Mid(tempValue, 9, 2) & "-" & Right(tempValue, 2)
Cells(i, "AC").Value = tempValue
Else
End If
Next i
End Sub
|