Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 590
Default Macro Help (Uppercase multiple ranges?)

Excel2003 ... following Code found in the Knowledge Base ... I altered Range
& Code works well ... Except: I have some Cols within my Range that contain
Forumula's which are being erased ...

Above said ... How do I edit this Code to properly work on multiple Ranges
.... as I am thinking I need to omit the cells containing Formulas.

Macro to Change All Text in a Range to Uppercase Letters

Sub Uppercase()
' Loop to cycle through each cell in the specified range.
For Each x In Range("A1:A5")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.value)
Next
End Sub

Thanks ... Kha

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro Help (Uppercase multiple ranges?)

Make the alteration like such............

For Each x In Range("A1:A5")
x.Formula = UCase(x.Formula)


Gord Dibben MS Excel MVP

On Mon, 27 Nov 2006 07:47:02 -0800, Ken wrote:

Excel2003 ... following Code found in the Knowledge Base ... I altered Range
& Code works well ... Except: I have some Cols within my Range that contain
Forumula's which are being erased ...

Above said ... How do I edit this Code to properly work on multiple Ranges
... as I am thinking I need to omit the cells containing Formulas.

Macro to Change All Text in a Range to Uppercase Letters

Sub Uppercase()
' Loop to cycle through each cell in the specified range.
For Each x In Range("A1:A5")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.value)
Next
End Sub

Thanks ... Kha


  #4   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 590
Default Macro Help (Uppercase multiple ranges?)

Gord ... (Happy morning) ... Excel2003

1 ... I am clueless when it comes to Code ... I record Macros only & then I
attempt to get creative with cut/paste ... (My highest respect to the Code
Writers.)

2 ... I revised Range from A1:A5 to my Range (G14:CB37)

3 ... I replaced ... x.Value = UCase(x.value) ... with ... x.Formula =
UCase(x.Formula)

4 ... I ran Macro & got Debug error which appeared to occur when the Macro
hit the 1st cell containing a formula.

Above said ... my Range is G14:CB37 with Formulas in Cols U, AJ, AY, BN & CC.

The Macro I found for this in the Knowledge appeared to work fine except it
was clearing my Formula's in the columns indicated.

So ... with this new found knowledge of my shortcomings in the understanding
of Code ... Can you tell me what further edits I need to make? ... Many
Thanks ... Kha





"Gord Dibben" wrote:

Make the alteration like such............

For Each x In Range("A1:A5")
x.Formula = UCase(x.Formula)


Gord Dibben MS Excel MVP

On Mon, 27 Nov 2006 07:47:02 -0800, Ken wrote:

Excel2003 ... following Code found in the Knowledge Base ... I altered Range
& Code works well ... Except: I have some Cols within my Range that contain
Forumula's which are being erased ...

Above said ... How do I edit this Code to properly work on multiple Ranges
... as I am thinking I need to omit the cells containing Formulas.

Macro to Change All Text in a Range to Uppercase Letters

Sub Uppercase()
' Loop to cycle through each cell in the specified range.
For Each x In Range("A1:A5")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.value)
Next
End Sub

Thanks ... Kha



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro Help (Uppercase multiple ranges?)

I re-tested using a range of A1:M55 with a mix of formula cells and text cells.

No problems.........formulas retained and all text to UPPER case

Sub Uppercase()
For Each x In Range("A1:M55")
x.Formula = UCase(x.Formula)
Next
End Sub


Gord

On Tue, 28 Nov 2006 08:20:02 -0800, Ken wrote:

Gord ... (Happy morning) ... Excel2003

1 ... I am clueless when it comes to Code ... I record Macros only & then I
attempt to get creative with cut/paste ... (My highest respect to the Code
Writers.)

2 ... I revised Range from A1:A5 to my Range (G14:CB37)

3 ... I replaced ... x.Value = UCase(x.value) ... with ... x.Formula =
UCase(x.Formula)

4 ... I ran Macro & got Debug error which appeared to occur when the Macro
hit the 1st cell containing a formula.

Above said ... my Range is G14:CB37 with Formulas in Cols U, AJ, AY, BN & CC.

The Macro I found for this in the Knowledge appeared to work fine except it
was clearing my Formula's in the columns indicated.

So ... with this new found knowledge of my shortcomings in the understanding
of Code ... Can you tell me what further edits I need to make? ... Many
Thanks ... Kha





"Gord Dibben" wrote:

Make the alteration like such............

For Each x In Range("A1:A5")
x.Formula = UCase(x.Formula)


Gord Dibben MS Excel MVP

On Mon, 27 Nov 2006 07:47:02 -0800, Ken wrote:

Excel2003 ... following Code found in the Knowledge Base ... I altered Range
& Code works well ... Except: I have some Cols within my Range that contain
Forumula's which are being erased ...

Above said ... How do I edit this Code to properly work on multiple Ranges
... as I am thinking I need to omit the cells containing Formulas.

Macro to Change All Text in a Range to Uppercase Letters

Sub Uppercase()
' Loop to cycle through each cell in the specified range.
For Each x In Range("A1:A5")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.value)
Next
End Sub

Thanks ... Kha




Gord Dibben MS Excel MVP


  #6   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 590
Default Macro Help (Uppercase multiple ranges?)

Gord ... (Good afternoon)

FYI ... Looks simple enough when you know what you are doing ... Macro is
working fine now ... Not sure what I did before (or didn't do?), but then ...
This is why I come to the Wizards of this board ... Thank you ... Kha

"Gord Dibben" wrote:

I re-tested using a range of A1:M55 with a mix of formula cells and text cells.

No problems.........formulas retained and all text to UPPER case

Sub Uppercase()
For Each x In Range("A1:M55")
x.Formula = UCase(x.Formula)
Next
End Sub


Gord

On Tue, 28 Nov 2006 08:20:02 -0800, Ken wrote:

Gord ... (Happy morning) ... Excel2003

1 ... I am clueless when it comes to Code ... I record Macros only & then I
attempt to get creative with cut/paste ... (My highest respect to the Code
Writers.)

2 ... I revised Range from A1:A5 to my Range (G14:CB37)

3 ... I replaced ... x.Value = UCase(x.value) ... with ... x.Formula =
UCase(x.Formula)

4 ... I ran Macro & got Debug error which appeared to occur when the Macro
hit the 1st cell containing a formula.

Above said ... my Range is G14:CB37 with Formulas in Cols U, AJ, AY, BN & CC.

The Macro I found for this in the Knowledge appeared to work fine except it
was clearing my Formula's in the columns indicated.

So ... with this new found knowledge of my shortcomings in the understanding
of Code ... Can you tell me what further edits I need to make? ... Many
Thanks ... Kha





"Gord Dibben" wrote:

Make the alteration like such............

For Each x In Range("A1:A5")
x.Formula = UCase(x.Formula)


Gord Dibben MS Excel MVP

On Mon, 27 Nov 2006 07:47:02 -0800, Ken wrote:

Excel2003 ... following Code found in the Knowledge Base ... I altered Range
& Code works well ... Except: I have some Cols within my Range that contain
Forumula's which are being erased ...

Above said ... How do I edit this Code to properly work on multiple Ranges
... as I am thinking I need to omit the cells containing Formulas.

Macro to Change All Text in a Range to Uppercase Letters

Sub Uppercase()
' Loop to cycle through each cell in the specified range.
For Each x In Range("A1:A5")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.value)
Next
End Sub

Thanks ... Kha



Gord Dibben MS Excel MVP

  #7   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 590
Default Macro Help (Uppercase multiple ranges?)

Gord ... (Hi again)

FYI ... Everything still workingfine ... My 1st shot @ editing the Macro as
you suggested should have also worked fine ... I am certain the initial
"Debug" issue was do to a "Protected" Sheet (Macro ok until it hit 1st Locked
Cell) ... I guess I should have paid more attention to the pop-up message ...
Such is life ... Thank you again for the guidance ... Kha

"Gord Dibben" wrote:

I re-tested using a range of A1:M55 with a mix of formula cells and text cells.

No problems.........formulas retained and all text to UPPER case

Sub Uppercase()
For Each x In Range("A1:M55")
x.Formula = UCase(x.Formula)
Next
End Sub


Gord

On Tue, 28 Nov 2006 08:20:02 -0800, Ken wrote:

Gord ... (Happy morning) ... Excel2003

1 ... I am clueless when it comes to Code ... I record Macros only & then I
attempt to get creative with cut/paste ... (My highest respect to the Code
Writers.)

2 ... I revised Range from A1:A5 to my Range (G14:CB37)

3 ... I replaced ... x.Value = UCase(x.value) ... with ... x.Formula =
UCase(x.Formula)

4 ... I ran Macro & got Debug error which appeared to occur when the Macro
hit the 1st cell containing a formula.

Above said ... my Range is G14:CB37 with Formulas in Cols U, AJ, AY, BN & CC.

The Macro I found for this in the Knowledge appeared to work fine except it
was clearing my Formula's in the columns indicated.

So ... with this new found knowledge of my shortcomings in the understanding
of Code ... Can you tell me what further edits I need to make? ... Many
Thanks ... Kha





"Gord Dibben" wrote:

Make the alteration like such............

For Each x In Range("A1:A5")
x.Formula = UCase(x.Formula)


Gord Dibben MS Excel MVP

On Mon, 27 Nov 2006 07:47:02 -0800, Ken wrote:

Excel2003 ... following Code found in the Knowledge Base ... I altered Range
& Code works well ... Except: I have some Cols within my Range that contain
Forumula's which are being erased ...

Above said ... How do I edit this Code to properly work on multiple Ranges
... as I am thinking I need to omit the cells containing Formulas.

Macro to Change All Text in a Range to Uppercase Letters

Sub Uppercase()
' Loop to cycle through each cell in the specified range.
For Each x In Range("A1:A5")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.value)
Next
End Sub

Thanks ... Kha



Gord Dibben MS Excel MVP

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro Help (Uppercase multiple ranges?)

Ken

Thanks for the feedback and letting us know the reason why you had a failure.

If you wish to run it on a protected sheet you can code it so's when you run it,
the sheet is mometarily unprotected, the text gets changed to UPPER case then
re-protected.

Your password may not be "justme"....adjust to suit.

Sub Uppercase()
ActiveSheet.Unprotect Password:="justme"
For Each x In Range("A1:M55")
x.Formula = UCase(x.Formula)
Next
ActiveSheet.Protect Password:="justme"
End Sub


Gord

On Tue, 28 Nov 2006 10:54:40 -0800, Ken wrote:

Gord ... (Hi again)

FYI ... Everything still workingfine ... My 1st shot @ editing the Macro as
you suggested should have also worked fine ... I am certain the initial
"Debug" issue was do to a "Protected" Sheet (Macro ok until it hit 1st Locked
Cell) ... I guess I should have paid more attention to the pop-up message ...
Such is life ... Thank you again for the guidance ... Kha

"Gord Dibben" wrote:

I re-tested using a range of A1:M55 with a mix of formula cells and text cells.

No problems.........formulas retained and all text to UPPER case

Sub Uppercase()
For Each x In Range("A1:M55")
x.Formula = UCase(x.Formula)
Next
End Sub


Gord

On Tue, 28 Nov 2006 08:20:02 -0800, Ken wrote:

Gord ... (Happy morning) ... Excel2003

1 ... I am clueless when it comes to Code ... I record Macros only & then I
attempt to get creative with cut/paste ... (My highest respect to the Code
Writers.)

2 ... I revised Range from A1:A5 to my Range (G14:CB37)

3 ... I replaced ... x.Value = UCase(x.value) ... with ... x.Formula =
UCase(x.Formula)

4 ... I ran Macro & got Debug error which appeared to occur when the Macro
hit the 1st cell containing a formula.

Above said ... my Range is G14:CB37 with Formulas in Cols U, AJ, AY, BN & CC.

The Macro I found for this in the Knowledge appeared to work fine except it
was clearing my Formula's in the columns indicated.

So ... with this new found knowledge of my shortcomings in the understanding
of Code ... Can you tell me what further edits I need to make? ... Many
Thanks ... Kha





"Gord Dibben" wrote:

Make the alteration like such............

For Each x In Range("A1:A5")
x.Formula = UCase(x.Formula)


Gord Dibben MS Excel MVP

On Mon, 27 Nov 2006 07:47:02 -0800, Ken wrote:

Excel2003 ... following Code found in the Knowledge Base ... I altered Range
& Code works well ... Except: I have some Cols within my Range that contain
Forumula's which are being erased ...

Above said ... How do I edit this Code to properly work on multiple Ranges
... as I am thinking I need to omit the cells containing Formulas.

Macro to Change All Text in a Range to Uppercase Letters

Sub Uppercase()
' Loop to cycle through each cell in the specified range.
For Each x In Range("A1:A5")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.value)
Next
End Sub

Thanks ... Kha



Gord Dibben MS Excel MVP


Gord Dibben MS Excel MVP
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
Run multiple excel files off of one macro. ahsya Excel Discussion (Misc queries) 5 October 4th 06 03:01 PM
Import multiple text files (Macro) Thr33of4 Excel Discussion (Misc queries) 0 September 19th 06 02:19 AM
Error using a macro to print multiple pages. [email protected] Excel Discussion (Misc queries) 2 June 21st 06 06:47 AM
How to Link named ranges from multiple Workbooks into a single Wo. PMAP_HELP Excel Discussion (Misc queries) 1 December 14th 04 05:51 PM
compare unique identifiers in multiple ranges bawilli_91125 Charts and Charting in Excel 1 November 30th 04 06:34 PM


All times are GMT +1. The time now is 07:11 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"