Can i setup cells to only accept caps

  • Thread starter Thread starter John McGing
  • Start date Start date
J

John McGing

IS THERE A WAY THAT A WORKSHEET CAN BE SETUP THAT WOULD
EITHER NOT ACCEPT LOWERCASE OR AUTOMATICALLY CHANGE IT TO
UPPERCASE
 
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
 
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
 

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