View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_5_] Bob Phillips[_5_] is offline
external usenet poster
 
Posts: 620
Default Proper Case with .

Graham,

Do you mean that 'job smith' becomes 'J.Smith'. If so, then try

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("E4:E300, F4:F300")) Is Nothing Then
With Target(1)
.Value = UCase(Left(.Value, 1)) & "." & _
StrConv(Right(.Value, Len(.Value) - 1),
vbProperCase)
End With
End If
Application.EnableEvents = True
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"graham gordon" wrote in message
...
Hi

I have managed to put this code together thanks
to "Pearson Software " websight but does anyone have
an idea on how I can add a (.) *thats period, after the first upper
case.

J. Smith




Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("E4:E300, F4:F300")) Is
Nothing Then
Target(1).Value = StrConv(Target(1).Value, vbProperCase)
End If
Application.EnableEvents = True
End Sub


thanks in advance
Graham

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!