PC Review


Reply
Thread Tools Rate Thread

Convert to uppercase

 
 
TheMilkGuy
Guest
Posts: n/a
 
      21st Sep 2010
Hi folks,

I'm trying to force a couple of ranges into uppercase. These cells
are mirrors of input from other pages. I want the users to feel free
to use upper or lower case, but have the end result in upper.

Here is the formula I was using:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Application.Intersect(Target, Range("Z2:AI2,Z3,Z4")) Is
Nothing) Then
With Target
If Not .HasFormula Then
.Value = UCase(.Value)
End If
End With
End If
End Sub

But it doesn't work, I suppose since these cells are full of formulae
like "=InputI19" and whatnot.

I tried changing the script but all I did was flatten the formula-
holding cells into straight text and then made that text uppercase.

Suggestions appreciated.

Cheers,
Craig
 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      22nd Sep 2010
The alpha character case for a cell with a formula is determined by the formula;
and there is no upper/lower case for numeric values, only font.name, font size and font.bold.

For those cells without formulas then perhaps your code is not specific enough.
The "Target" is whatever was selected by the user and that could be multiple cells.
The conventional method is to use "Target(1)" to avoid selection problems or to force user compliance...
'--
Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Application.Intersect(Target(1), _
Range("Z2:AI2,Z3,Z4")) Is Nothing) Then
If Not Target(1).HasFormula Then
Target(1).Value = UCase(Target(1).Value)
End If
End If
End Sub
'--
Jim Cone
Portland, Oregon USA
http://www.contextures.com/excel-sort-addin.html
(Special Sort Excel add-in)

..
..
..

"TheMilkGuy" <(E-Mail Removed)>
wrote in message
news:762f63fe-d836-4af8-bc69-(E-Mail Removed)...
Hi folks,

I'm trying to force a couple of ranges into uppercase. These cells
are mirrors of input from other pages. I want the users to feel free
to use upper or lower case, but have the end result in upper.

Here is the formula I was using:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Application.Intersect(Target, Range("Z2:AI2,Z3,Z4")) Is Nothing) Then
With Target
If Not .HasFormula Then
.Value = UCase(.Value)
End If
End With
End If
End Sub

But it doesn't work, I suppose since these cells are full of formulae
like "=InputI19" and whatnot.

I tried changing the script but all I did was flatten the formula-
holding cells into straight text and then made that text uppercase.

Suggestions appreciated.

Cheers,
Craig
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Cells to uppercase ordnance1 Microsoft Excel Programming 1 3rd Mar 2010 09:24 AM
Convert uppercase to lowercase Mervyn Thomas Microsoft Excel Programming 9 22nd Dec 2009 07:13 PM
Convert cells to uppercase Fan924 Microsoft Excel Programming 5 21st Feb 2009 12:44 PM
How do I convert text to uppercase? =?Utf-8?B?YmIzMDAwbWE=?= Microsoft Excel Misc 2 23rd Sep 2004 05:28 AM
Import and convert to Uppercase Doug Bell Microsoft Access External Data 1 2nd Apr 2004 04:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:22 AM.