Put this in a standard module of your PERSONAL.XLS and use it anytime
you need to change case...
Sub ProperCase()
Application.ScreenUpdating = False
For Each c In Selection: c.Value = Application.Proper(c.Value): Next
End Sub
Here's a few more in case you're interested in adding a custom menu to
your formatting toolbar:
Sub UpperCase()
Dim c
Application.ScreenUpdating = False
For Each c In Selection: c.Value = UCase(c.Value): Next
End Sub
Sub LowerCase()
Dim c
Application.ScreenUpdating = False
For Each c In Selection: c.Value = LCase(c.Value): Next
LCase(Mid(c.Value, 2)): Next
End Sub
Sub SentenceCase()
Dim c
Application.ScreenUpdating = False
For Each c In Selection.Cells
s = c.Value
Start = True
For i = 1 To Len(s)
Ch = Mid(s, i, 1)
Select Case Ch
Case ".", "?": Start = True
Case "a" To "z": If Start Then Ch = UCase(Ch): Start = False
Case "A" To "Z": If Start Then Start = False Else Ch =
LCase(Ch)
End Select
Mid(s, i, 1) = Ch
Next
c.Value = s
Next
End Sub
--
Garry
Free usenet access at
http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion