View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Insert blank space

Try something like the following:

Sub AAA()
Dim Rng As Range
Dim S As String
Set Rng = Range("A3")
S = Rng.Text
If Len(S) = 4 Then
If Mid(S, 3, 1) < " " Then
S = Left(S, 2) & " " & Mid(S, 3)
End If
Rng.Value = S
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Ed Peters" wrote in message
ups.com...
Hi,

I have a variable length data in a cell.

I need to be able to insert a blank space after the 3rd character from
the right if one does not already exist.

How would I go about doing this?

Thanks,

Ed