Force CAPITAL LETTERS

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

Is there any way to all text on a worksheet to be capitalized?
 
You could add a onchange event on your worksheet.
as soon as something is changed, capitalize it:

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Value = UCase(Target.Value)
End Sub

hth
Carlo
 
Be carful with this because you can't enter formulas anymore in the worksheet when you use this.
It will make it a value after you press enter after you enter or edit the formula.

Try this

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Target.HasFormula Then Target.Value = UCase(Target.Value)
End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


You could add a onchange event on your worksheet.
as soon as something is changed, capitalize it:

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Value = UCase(Target.Value)
End Sub

hth
Carlo
 
Also you need to handle multiple selections error values:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
For Each c In Target
If Not c.HasFormula And Not IsError(c.Value) Then c.Value =
UCase(c.Value)
Next
End Sub
 
You're absolutely right.
Sorry, didn't consider that, thanks for telling me.

Carlo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top