Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Field to All CAPS 1

Status
Not open for further replies.

deintinis

IS-IT--Management
Nov 14, 2001
174
US
Is there a way to format cells so they appear in capital letters no matter how it is typed in?
 
Use the upper function to raise caps of all text. E.g:

UPPER("total") equals "TOTAL"

If A1 contains "Hello", then:

UPPER(A1) equals "HELLO"

Although I am sure that you could create a custom format for cells that would raise the caps to uppercase.

I'll try and work on it if you need it.
 
I am trying to figure out how to apply it to a set of cells. The only way I have found out to do it is by creating another column with the formula =UPPER(A1)and auto filling down. I would like to try to do it without adding the other column.
 
OK, it looks like you need a custom type format. Let me try and work on it and let you have it asap.
 
Hi,

1. Select the cell tiy want to capitalize

2. run this macro
Code:
Sub UpCase()
    ActiveCell.Value = UCase(ActiveCell.Value)
End Sub

3. to do a range, you will have to write another macro to select each cell in the range.
 
I couldn't get a decent custom format to work, but it looks like Skip's answer is the right one! :)
 
Could I get a little help on writing a macro that will do the entire column at once.
Thanks
 
Here is a way,
1. highlight the data you want to capitalze
2. run the following code...
Code:
Sub CapRange()
    For Each cell In Selection
        cell.Select
        UpCase
    Next
End Sub

Sub UpCase()
    ActiveCell.Value = UCase(ActiveCell.Value)
End Sub
Skip,
metzgsk@voughtaircraft.com
 
Skip,
I tried the code but got a compiler error. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top