ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Force CAPITAL LETTERS (https://www.excelbanter.com/excel-programming/404520-force-capital-letters.html)

Patrick C. Simonds

Force CAPITAL LETTERS
 
Is there any way to all text on a worksheet to be capitalized?

carlo

Force CAPITAL LETTERS
 
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

On Jan 18, 4:10*pm, "Patrick C. Simonds"
wrote:
Is there any way to all text on a worksheet to be capitalized?



Ron de Bruin

Force CAPITAL LETTERS
 
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


"carlo" wrote in message ...
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

On Jan 18, 4:10 pm, "Patrick C. Simonds"
wrote:
Is there any way to all text on a worksheet to be capitalized?



Andrew Taylor

Force CAPITAL LETTERS
 
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



On 18 Jan, 08:07, "Ron de Bruin" wrote:
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 Bruinhttp://www.rondebruin.nl/tips.htm

"carlo" wrote in ...

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

On Jan 18, 4:10 pm, "Patrick C. Simonds"
wrote:

Is there any way to all text on a worksheet to be capitalized?



Ron de Bruin

Force CAPITAL LETTERS
 
Correct

See this two pages also for the whole story

http://www.mvps.org/dmcritchie/excel/proper.htm
Or
http://www.cpearson.com/excel/case.htm


--

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


"Andrew Taylor" wrote in message
...
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



On 18 Jan, 08:07, "Ron de Bruin" wrote:
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 Bruinhttp://www.rondebruin.nl/tips.htm

"carlo" wrote in ...

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

On Jan 18, 4:10 pm, "Patrick C. Simonds"
wrote:

Is there any way to all text on a worksheet to be capitalized?




carlo

Force CAPITAL LETTERS
 
You're absolutely right.
Sorry, didn't consider that, thanks for telling me.

Carlo

On Jan 18, 9:41*pm, "Ron de Bruin" wrote:
Correct

See this two pages also for the whole story

http://www.mvps.org/dmcritchie/excel/proper.htm
Orhttp://www.cpearson.com/excel/case.htm

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm

"Andrew Taylor" wrote in message

...



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


On 18 Jan, 08:07, "Ron de Bruin" wrote:
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 Bruinhttp://www.rondebruin.nl/tips.htm


"carlo" wrote in ...


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


On Jan 18, 4:10 pm, "Patrick C. Simonds"
wrote:


Is there any way to all text on a worksheet to be capitalized?- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 08:35 PM.

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