How do I set caps lock as default?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In an Excel worksheet, I have two cells in which I only want to enter four
letters of text each.

How can I set these cells to only display caps?

Thank you!

Mark Barnard
(e-mail address removed)
 
Hi Mark,
I'm glad you want to be selective in what is capitalized.
You would want to use a Change Event Macro. Normally
this would encompass an entire column but for only two
cells the macro following was adapted from
http://www.mvps.org/dmcritchie/excel/event.htm#change_v

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo ErrHandler
If Target.Address = "$C$4" Or Target.Address = "$C$5" Then
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
End If
ErrHandler:
Application.EnableEvents = True
End Sub


To install right click on the sheet tab, then
"View Code", place the above macro after
the Option Explict statement

For more examples see
http://www.mvps.org/dmcritchie/excel/event.htm
http://www.mvps.org/dmcritchie/excel/proper.htm
 

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