Changing lower case to upper case

  • Thread starter Thread starter Dazza
  • Start date Start date
D

Dazza

Hi, is there a way to enter lower case text into a cell,
say A1, and upon exiting that cell the text automatically
reverts to upper case?

If this is not possible, is there a way to change the cell
to upper case by inserting VB code into command button
macro?

Cheers,
D
 
In the module for the worksheet you want to run this code in, enter th
following code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value <> "" Then Target.Value = UCase(Target.Value)
End Sub
 
Hi thanks for the help. I have placed this code in the
worksheet midule as advised however I keep getting an
error. How do I limit the target to A14 to A54?
 
Hi!

Use the following modification:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("A14:A54")) Is Nothing Then Exit Sub
If Target.Value <> "" Then Target.Value = UCase(Target.Value)
End Sub
 
Back
Top