Matt,
If you want "Title Case" as it's called in MS Word, use (A1 being the first cell that contains word(s)) in B1
=PROPER(A1)
If you want "Sentence Case" as it's called in MS Word, use in B1
=CONCATENATE(UPPER(MID(A1,1,1)),MID(A1,2,LEN(A1)-1))
Aladin
Try this macro which uses the proper command.
The Proper command Capitalizes the first letter in a text string and any other letters in text that follow any character other than a letter. Converts all other letters to lowercase letters.
Sub MakeProper()
Dim TextRgCaseChg As Range
Dim cell
Set TextRgCaseChg = Selection.SpecialCells(xlCellTypeConstants, 2)
For Each cell In TextRgCaseChg.Cells
cell.Value = Application.WorksheetFunction.Proper(cell.Text)
Next
End Sub
Ivan
I don't know why but if only one cell is selected, the line that reads "Set TextRgCaseChg = Selection.SpecialCells(xlCellTypeConstants, 2)" seems to assign ALL text cells on the worksheet to the variable.
I use the following macro to convert to Proper case :-
Sub TextProperCase()
Dim rng As Range, cell As Range
Set rng = Intersect(ActiveSheet.UsedRange, Selection)
For Each cell In rng
If cell.HasFormula = False Then
cell.Value = StrConv(cell.Value, vbProperCase)
End If
Next cell
End Sub
Celia
My mistake the macro actually DOES ALL cells
in the active sheet with text and not a column
range as specified :-(
Ivan