View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ken Loomis Ken Loomis is offline
external usenet poster
 
Posts: 143
Default Change all text in a column to uppercase

I think I figured out how to do that without activating the sheet.

I changed:

Set rng = Intersect(Columns(2), ActiveSheet.UsedRange)

to:

Set rng = Intersect(Worksheets("Enter Here").Columns(2),
Worksheets("Enter Here").UsedRange)

And that works.

Thanks for all your help, Norman. I'm sure I'll need more.

Ken Loomis


"Norman Jones" wrote in message
...
Hi Ken,

Try:

Sub Tester()
Dim rng As Range, rCell As Range

On Error Resume Next
Set rng = Intersect(Columns(2), ActiveSheet.UsedRange)
On Error Resume Next
For Each rCell In rng.SpecialCells(xlCellTypeConstants, 2)

rCell.Value = UCase(myCell)
Next rCell
On Error GoTo 0

End Sub

---
Regards,
Norman



"Ken Loomis" wrote in message
...
Is there a way to change all text in a column to upper case.

I tried this:

Worksheets("Enter Here").Range("B:B").Value = _
UCase(Worksheets("Enter Here").Range("B:B").Value)


But, as I am sure most of you here can tell, that did not work.

Is it because I am not accesing the column correctly, or do I just need
to use UCase on each individual cell?

Thanks,
Ken Loomis