Forcing all caps in a column

D

Dr. Indera

hello,

i'd like to know if there is a way to force specific text cells to be all
caps, regardless of what is entered.

thank you
indera
 
F

Frank Kabel

Hi
that is only possible using VBA. Try the following (works for column A)

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A:A")) Is Nothing Then Exit Sub
On Error GoTo CleanUp:
With Target
if .value<>"" then
Application.EnableEvents = False
.Value = UCase(.value)
end if
End With
CleanUp:
Application.EnableEvents = True
End Sub
 
Z

Zygoid

could this same formula be used to make the column proper bu changin
UCase to proper
 
F

Frank Kabel

Hi
yes. change the line
..Value = UCase(.value)
to
..Value = application.worksheetfunction.proper(.value)
 

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

Top