View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Can I change case automatically without using PROPER function?

John,

You can use the worksheet change event. Right click your sheet tab, view
code and paste this in

As written it applies to the entire sheet. If you want to limit this to a
specific range then remove the comment marks from the if-end if and set yopu
range as required.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or Target.HasFormula Then Exit Sub
On Error Resume Next
'If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
Application.EnableEvents = False
Target = StrConv(Target, vbProperCase)
Application.EnableEvents = True
'End If
End Sub

Mike

"John" wrote:

Can I change the case in cells without using the PROPER function. What i mean
by that is if I type - 'the happy dog' in a cell I want it to appear as 'The
Happy Dog' automatically WITHOUT having to use the PROPER function.