Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Change all text in a column to uppercase

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Change all text in a column to uppercase

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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Change all text in a column to uppercase

Thanks, Norman.

As usual, your suggestion worked.

I did have to change:

rCell.Value = UCase(myCell)

to:

rCell.Value = UCase(rCell)

but at least I am starting to be able to figure stuff like that out.

This sub requires the sheet "Enter Here" to be active.

Is there a way to do this without activating that sheet first?

Thanks,
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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Change all text in a column to uppercase

Hi Ken,

I changed variable names and missed one. Fortunately you spotted it!

---
Regards,
Norman



"Ken Loomis" wrote in message
...
Thanks, Norman.

As usual, your suggestion worked.

I did have to change:

rCell.Value = UCase(myCell)

to:

rCell.Value = UCase(rCell)

but at least I am starting to be able to figure stuff like that out.

This sub requires the sheet "Enter Here" to be active.

Is there a way to do this without activating that sheet first?

Thanks,
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








  #5   Report Post  
Posted to microsoft.public.excel.programming
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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Change all text in a column to uppercase

or even:

with worksheets("enter here")
Set rng = Intersect(.Columns(2), .UsedRange)
end with

Less typing and easier to read???



Ken Loomis wrote:

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





--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Change all text in a column to uppercase

Hi Ken,

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

I changed:

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


Actually,

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

does not activate the sheet; it merely refers to the sheet which is
currently active.

If you want to ensure that the macro only operates on a specific sheet, by
all means hardcode the sheet name, as you have done. Using ActiveSheet
provides some flexibility in that the macro can be used on any sheet (in any
workbook), providing that the sheet is the active sheet.


---
Regards,
Norman



"Ken Loomis" wrote in message
...
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








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Change all text in a column to uppercase

Ken Loomis wrote:

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



Range("A:A").FormulaArray = _
"=UPPER('Enter Here'!" & Worksheets("Enter _
Here").Range("B:B").Address & ")"

Alan Beban
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW TO CHANGE EXISTING XL DATA SHEET TO ALL UPPERCASE TEXT John Excel Discussion (Misc queries) 5 May 30th 07 05:59 AM
Use "PROPER" to change UPPERCASE text to Title Case on worksheet cmurdock Excel Worksheet Functions 1 January 31st 06 11:19 PM
How do I change certain cells to Uppercase TazDevil Excel Worksheet Functions 4 August 1st 05 06:35 AM
Automatically change text to uppercase Santie Excel Worksheet Functions 1 February 22nd 05 05:20 PM
How to change text in multiple cells from Uppercase to proper cas. Excel help Excel Worksheet Functions 1 November 17th 04 03:45 AM


All times are GMT +1. The time now is 11:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"