On Tue, 22 May 2007 20:30:35 -0500, Barry wrote in
microsoft.public.excel:
>Further explanation to my requested code.
>
>The following code does what I want only if I change something in each cell.
>My hope is to use code to automatically change the text in all cells in one
>effort.
>Private Sub Worksheet_Change(ByVal Target As Excel.Range)
>Dim TheCell As Range
>Application.EnableEvents = False
>For Each TheCell In Target
> If TheCell.HasFormula = False Then
> If Not Application.Intersect(TheCell, Range("A1:A10")) Is
>Nothing Then
> TheCell.Value = UCase(TheCell.Value)
> End If
> End If
>Next TheCell
>Application.EnableEvents = True
>End Sub
I may be missing something, but doesn't this trivial code do what you
want:
Sub SelUCase()
Dim rngCell As Range
For Each rngCell In Selection
rngCell = UCase(rngCell)
Next rngCell
End Sub
and then Alt+F8, or Menu: Tools/Macro/Macros..., or a button assigned to
the macro, to run it on the selected cells.
--
Michael Bednarek
http://mbednarek.com/ "POST NO BILLS"