View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Replace pattern of characters

On Wed, 21 Mar 2007 13:45:00 -0700, Fernando
wrote:

Thank you for your help.

I was hoping for an easier way, but I guess a macro won't be that bad.

Thanks for your replies.



Option Explicit

Sub Slash()
Dim c As Range

For Each c In Selection
If Len(c.Text) = 8 Then
c.Value = Left(c.Text, 4) & "/" & Right(c.Text, 4)
End If
Next c
End Sub

--ron