Uppercase text

Brutium

Board Regular
Joined
Mar 27, 2009
Messages
188
:)Hello ALL!!!

Is it possible to have only a number of cells (say C5:N33 and P5:P33) to have the text show in "UPPERCASE", even though the user inputs it in "lowercase"?
How would I accomplish this?
Thank you!
 

Asala42

Well-known Member
Joined
Feb 26, 2002
Messages
2,318
I don't know of a simple format setting approach, but there are formulas you could use.

For example: =UPPER(P2) will output P2 content in Upper Case.
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
It requires VBA code..

Right click the Sheet's Tab, View Code
Paste the following

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range, c As Range
Set MyRange = Intersect(Target, Range("C5:C33, P5:P33"))
If Not MyRange Is Nothing Then
    Application.EnableEvents = False
    For Each c In MyRange
        c.Value = UCase(c.Value)
    Next c
    Application.EnableEvents = True
End If
End Sub
 

Brutium

Board Regular
Joined
Mar 27, 2009
Messages
188
Thanky ou Asala 42 and Trevor G, I am not sure how I could get the results I am looking for. Do I place the formula in each cells?

Jonmo1, I tried your code, but it does not work. I placed your code as you suggested, but I still get lower case. Also I noticed that you identified the range as C3:C33, no, the range is C3:N33, and of course, all the cells inbetween.

Thank you all for your support.
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
OK, my bad..

Change that line to

Set MyRange = Intersect(Target, Range("C5:N33, P5:P33"))
 

Asala42

Well-known Member
Joined
Feb 26, 2002
Messages
2,318
The UPPER formula is intended for an adhoc kind of thing.

In a range off to the right of your data range, you can write a formula similar to =UPPER(P2), copy it down, then copy/paste special/Values over the original column (basically overwriting the original entries with an uppercase version).

Given the number of columns, it probably won't take that long - but it is a manual process. Code can be used to automate the process, as Jonmo is doing.
 

Brutium

Board Regular
Joined
Mar 27, 2009
Messages
188
Thank you Jonmo1,
It works just as you said. It will be very useful in what I am trying to accomplish.
I am not sure if I should be asking this question in this thread or start a new one.

How can I limit the lettes that can go in the cells I mentioned earlier...
that is to say, I want only A+, A, A-, B+, B, B-, C+, C, C-, D+ D, D- and R. No other letter will be allowed in the table.
 

Forum statistics

Threads
1,082,040
Messages
5,362,804
Members
400,693
Latest member
jenlj

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top