Capitalize all words on input

  • Thread starter Thread starter Danny
  • Start date Start date
D

Danny

Try this macro:
Macro MUST be in the SHEET

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
'Make sure to identify the Range(s)
If Not Application.Intersect(Target, Range("A1:A20")) Is
Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
Application.EnableEvents = True
End Sub
 
Thanks. That worked. The only thing is I didn't explain
myself properly. I'm trying to capitalize just the first
letter of each word. What would I use in place of UCase
to accomplish that?
 
Target(1).Value = StrConv(Target, vbProperCase)
Thanks. That worked. The only thing is I didn't explain
myself properly. I'm trying to capitalize just the first
letter of each word. What would I use in place of UCase
to accomplish that?
 
Back
Top