Thread: Capital letters
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Capital letters

Hi,

Am Wed, 7 Sep 2016 23:12:11 -0700 (PDT) schrieb Akash Maheshwari:

How can I ensure that only capital letters are keen in specific cells of a specific sheet.


what exactly do you want? Do you want to enter only a single character?
Then try it with Data Validation = Custom:
=AND(CODE(A1)=65,CODE(A1)<=90)

If a whole word or string should be in capital letters try it with
Worksheet_Change event:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A:A")) Is Nothing Or _
Target.Count 1 Then Exit Sub

Application.EnableEvents = False
On Error GoTo CleanUp

Target = UCase(Target)

CleanUp:
Application.EnableEvents = True
End Sub


Regards
Claus B.
--
Windows10
Office 2016