Proper Case

B

Brian

How do Ensure that when a name and initials are typed into a column,
the initials and first letter of the Surname will be converted to
Capital letters if it was not typed correctly. Names in the column
should be entered like this "Black B F" but I often get names in
lowercase or all capital letters.

Can anyone help
 
B

Bob Phillips

Brian,

To trap thye input needs VBA.

Add this code to the sheet code module (right-click the sheet tab name,
select View Code from the menu, then paste the code into the window). This
is for column A, adjust to suit.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo ws_exit
With Target
If .Column = 1 Then
.Value = WorksheetFunction.Proper(.Value)
End If
End With

ws_exit:
Application.EnableEvents = True
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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