Capitalize all words on input

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
 
S

shaggles

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?
 
T

Thomas

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?
 

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