Upper CaseText


Posted by Barrie Bowdler on September 26, 2001 3:14 AM

How can I force a text cell to display/print only in Upper Case?

Posted by eric on September 26, 2001 10:01 AM

I don't think you can.
But you can always convert the contents afterwords, by cutting all the contents, pasting them into word, formatting the contents font to caps, and repasting them.



Posted by Henry on September 26, 2001 9:09 PM

Well ... it can be done, but with VBA.

Assuming you want to force cell A1 on Sheet1 to be upper case, put this in the workbook code module :-

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If ActiveSheet.Name <> "Sheet1" Then Exit Sub
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
If Not Intersect(Selection, ws.Range("A1")) Is Nothing Then
ws.Range("A1").Value = UCase(ws.Range("A1").Value)
End If
End Sub

However, the above will convert a formula in the cell to a value only. If you may have a formula in cell A1, different code would be needed if the formula needs to be retained.