View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Piotr Zaniewski Piotr Zaniewski is offline
external usenet poster
 
Posts: 4
Default Simple Text Editing Macro Help

Macro recorder isn't the bect solution for this, try something like:

Option Explicit

Sub colon()
Dim rng As Range
Dim c As Range
Dim dl As String

Set rng = Range("a1:a100")
Cells.NumberFormat = "@"
For Each c In rng
dl = Len(c)
c.Value = Left(c, 2) & ":" & Mid(c, 3, dl)
Next
End Sub

you can set any range you want, numberformat is used to force format
to text

regards

Piotr