Proper case

  • Thread starter Thread starter Mark
  • Start date Start date
Hi Mark!

Here's an extract from Chip Pearson's website:

The following procedure will change all of the text in the selected
cells to upper case.

Sub ConvertToUpperCase()
Dim Rng As Range
For Each Rng In Selection.Cells
If Rng.HasFormula = False Then
Rng.Value = UCase(Rng.Value)
End If
Next Rng
End Sub



Chip's sit is well worth bookmarking. Here's the link to the topics
page:

Chip Pearson:

http://www.cpearson.com/excel/topic.htm


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
If you use specialcells it is faster

See David his page about it also
http://www.mvps.org/dmcritchie/excel/proper.htm

Or this one for the selection

Sub Propercase_macro()
Dim selectie As Range
Dim cel As Range
On Error Resume Next
Set selectie = Range(ActiveCell.Address & "," & Selection.Address) _
.SpecialCells(xlCellTypeConstants, xlTextValues)
If selectie Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For Each cel In selectie
cel.Value = StrConv(cel.Value, vbProperCase)
Next cel
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
 
Back
Top