ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format Cell for All Cap Text (https://www.excelbanter.com/excel-programming/293583-format-cell-all-cap-text.html)

scrabtree[_2_]

Format Cell for All Cap Text
 
I need to format cells so it will convert all text entry
to caps.

Tom Ogilvy

Format Cell for All Cap Text
 
Sub tester9()
Dim rng As Range
Set rng = Cells.SpecialCells(xlConstants, xlTextValues)
For Each cell In rng
cell.Value = StrConv(cell.Value, vbUpperCase)
Next

End Sub


--
Regards,
Tom Ogilvy



"scrabtree" wrote in message
...
I need to format cells so it will convert all text entry
to caps.




Gord Dibben

Format Cell for All Cap Text
 
scrab

You can't format cells in this manner.

You can keep the Caps Lock on or use code.

Tom O. has given code to change "after the fact".

This worksheet event code will change to Upper case when you exit the cells.

As written works in Columns A through C.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column 3 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
ErrHandler:
Application.EnableEvents = True
End Sub

Gord Dibben Excel MVP

On Fri, 5 Mar 2004 09:18:58 -0800, "scrabtree"
wrote:

I need to format cells so it will convert all text entry
to caps.




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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com