Hi
Function InsertSymbol(TxtString As String, Symbol As String, _
AfterEvery As Integer) As String
Dim j As Integer
Dim NewString As String
For j = 1 To Len(TxtString) Step AfterEvery
NewString = NewString & Mid(TxtString, j, AfterEvery) & Symbol
Next j
InsertSymbol = Left(NewString, Len(NewString) - 1)
End Function
How to use: - Copy above code.
- In Excel press Alt + F11 to enter the VBE.
- Press Ctrl + R to show the Project Explorer.
- Choose Insert -> Module.
- Paste code into the right pane.
- Press Alt + Q to close the VBE.
- Save workbook before any other changes.
Then use this formula
=InsertSymbol(SUBSTITUTE(A1,".",""),":",2)
Bookmarks