UPPER CASE PROBLEM

  • Thread starter Thread starter CINZIA
  • Start date Start date
C

CINZIA

HI ,
CAN ANYONE HELP PLEASE?
IT SEEMS QUITE SIMPLE BUT I CAN'T FIND A SOLUTION.
I HAVE AN EXCEL FILE WHICH IS UPDATED BY A MACRO EVERY
DAY. IT CONTAINS A FEW COLUMNS AND SOME OF THEM ARE
FORMATTED AS TEXT. I NEED TO VISUALIZE ALL THE TEXT INTO
UPPER CASE.
THANKS
CINZIA
 
You need to use the UPPER() function.

As an example if you had the text "upper" in cell A1 and
entered the formula =UPPER(A1) in another cell then the
result would display as "UPPER". It may be worth amending
the Macro to change the text to uppercase when it runs.
 
Following from an old post of Dave Peterson's should do that for you:-

Sub MakeProperCase()
Application.ScreenUpdating = False

Dim myCell As Range
Dim myRng As Range

On Error Resume Next
Set myRng = Intersect(Selection, _
Selection.Cells _
.SpecialCells(xlCellTypeConstants, xlTextValues))
On Error GoTo 0

If myRng Is Nothing Then
MsgBox "Please select a range that contains text--no formulas!"
Exit Sub
End If

For Each myCell In myRng.Cells
myCell.Value = StrConv(myCell.Value, vbProperCase)
Next myCell

Application.ScreenUpdating = True
End Sub
 
Back
Top