View Single Post
  #4   Report Post  
Gord Dibben
 
Posts: n/a
Default

FYI and hopefully a tip. Are you aware with that code, if there are any
formulas in the range they will be wiped leaving values only?

I realize OP mentioned text only but on the odd chance that some of the text
seen may be the results of formulas the following code would not affect
formulas. It will however, change case of any text returned by a formula as
well as in text-only cells.

Just select a range and run code.

Sub Upper_Case()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Selection
cell.Formula = UCase(cell.Formula)
Next
Application.ScreenUpdating = True
End Sub

On Fri, 22 Apr 2005 23:25:56 +0800, "JulieD"
wrote:

Hi

posted by Bob Phillips in response to a similar question earlier tonight ...
this code
----
Sub changecase()
For Each cell In Activesheet.UsedRange
If Not IsNumeric(cell.Value) Then
cell.Value = UCase(cell.Value)
End If
Next cell
End sub
---

to use, right mouse click on the sheet tab and choose view code on the left
hand side of the VBE window you should be able to see your workbook's name
(in bold & brackets) .. if not, choose view / project explorer ... then
choose insert / module - a piece of white paper should appear on the right,
copy & paste the code in there and then use alt & F11 to return to your
workbook, go to the sheet with your data, click in a cell .. choose tools /
macro / macros and click on changecase and then click on RUN.

PS it is always a good idea to do this on a copy of your workbook just in
case.