ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can i setup cells to only accept caps (https://www.excelbanter.com/excel-programming/287986-can-i-setup-cells-only-accept-caps.html)

John McGing

Can i setup cells to only accept caps
 
IS THERE A WAY THAT A WORKSHEET CAN BE SETUP THAT WOULD
EITHER NOT ACCEPT LOWERCASE OR AUTOMATICALLY CHANGE IT TO
UPPERCASE

Dave Ramage[_3_]

Can i setup cells to only accept caps
 
Add this code to the worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range

Application.EnableEvents = False
For Each r In Target
r.Formula = UCase(r.Formula)
Next r
Application.EnableEvents = True
End Sub

(right-clcik the worksheet tab and select View Code to
bring up the VBA editor)

Cheers,
Dave
-----Original Message-----
IS THERE A WAY THAT A WORKSHEET CAN BE SETUP THAT WOULD
EITHER NOT ACCEPT LOWERCASE OR AUTOMATICALLY CHANGE IT TO
UPPERCASE
.


Paul Robinson

Can i setup cells to only accept caps
 
Hi John

Open up the visual basic editor, look in the Project Window and double
click the worksheet this behavior is to apply to. Paste the code below
into the blank code module

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

and save the file. Everything entered on this sheet will then appear
in upper case.

regards
Paul

"John McGing" wrote in message ...
IS THERE A WAY THAT A WORKSHEET CAN BE SETUP THAT WOULD
EITHER NOT ACCEPT LOWERCASE OR AUTOMATICALLY CHANGE IT TO
UPPERCASE



All times are GMT +1. The time now is 02:14 AM.

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