Re: automatically changing text case

From: Paul B (newspab_at_surfbest.net)
Date: 03/24/04


Date: Wed, 24 Mar 2004 18:50:00 -0500

Susan, here is a macro by Ivan F Moala that will do what you want

Sub TextConvert()
'By Ivan F Moala
'will change the text that you have selected,
'if no text is selected it will change the whole ***
Dim ocell As Range
Dim Ans As String

Ans = Application.InputBox("Type in Letter" & vbCr & _
"(L)owercase, (U)ppercase, (S)entence, (T)itles ")

If Ans = "" Then Exit Sub

For Each ocell In Selection.SpecialCells(xlCellTypeConstants, 2)
Select Case UCase(Ans)
Case "L": ocell = LCase(ocell.Text)
Case "U": ocell = UCase(ocell.Text)
Case "S": ocell = UCase(Left(ocell.Text, 1)) & _
LCase(Right(ocell.Text, Len(ocell.Text) - 1))
Case "T": ocell = Application.WorksheetFunction.Proper(ocell.Text)
End Select
Next

End Sub

-- 
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"SusanC" <anonymous@discussions.microsoft.com> wrote in message
news:7CB0A4C9-B2D6-4E89-A08B-1EA1B808C0A8@microsoft.com...
> I am merging several different excel spreadsheets and some of the names
are in all uppercase and some are first initial of name in uppercase and the
rest in lowercase. Is there an easy way (as in Word) to highlight all the
names in uppercase and automatically change them to first letter uppercase,
rest lower case???