UPPER CASE PROBLEM

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
 
M

Mark

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.
 
K

Ken Wright

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top