You can only do this with code. There is no formatting command that
can be used. Right-click on the appropriate worksheet tab, choose View
Code, and paste in the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrH:
If Target.Cells.Count > 1 Then
Exit Sub
End If
If Not Application.Intersect(Target, _
Me.Range("A1:A10")) Is Nothing Then
Application.EnableEvents = False
If Target.HasFormula = False Then
If Target.HasArray = False Then
If Len(Target.Text) > 0 Then
If IsNumeric(Target.Text) = False Then
Target.Value = UCase(Left(Target.Text, 1)) & _
Mid(Target.Text, 2)
End If
End If
End If
End If
End If
ErrH:
Application.EnableEvents = True
End Sub
Change the reference A1:A10 to the range of cells that you want to
automatically change. If you want the have the code automatically
change entries in ALL cells on the worksheet, use the following code
rather than the code above:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrH:
If Target.Cells.Count > 1 Then
Exit Sub
End If
Application.EnableEvents = False
If Target.HasFormula = False Then
If Target.HasArray = False Then
If Len(Target.Text) > 0 Then
If IsNumeric(Target.Text) = False Then
Target.Value = UCase(Left(Target.Text, 1)) & _
Mid(Target.Text, 2)
End If
End If
End If
End If
ErrH:
Application.EnableEvents = True
End Sub
The code will not modify numeric values and will not modify cells that
contains formulas or arrays.
Close VBA from the File menu to return to Excel.
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)