The following macro should do what you want; it puts in all caps each cell in the current
selection.
Sub macro()
Dim cel As Object
Dim foo As String, bar As String
For Each cel In Selection
foo = cel.Formula
if foo <> "" then
bar = Format(foo, ">")
cel.Formula = bar
end if
Next cel
End Sub
This doesn't work very well for an entire sheet:
in that case, use ActiveSheet.UsedRange instead
of Selection.
HTH
For Each cel In Selection foo = cel.Formula if foo <> "" then bar = Format(foo, ">") cel.Formula = bar end if Next cel
As suggested by Tim, the following should work whether the selection is the whole sheet or some smaller range(s):-
Dim rng As Range, cel As Range
Set rng = Intersect(ActiveSheet.UsedRange, Selection)
For Each cel In rng
If cel.Formula <> "" Then
cel.Formula = Format(cel.Formula, ">")
End If
Next cel
Celia