Title Case Validation

  • Thread starter Thread starter jen2018
  • Start date Start date
J

jen2018

How can I make sure that people enter information into a cell in Title Case?
 
Hi,

Right click your sheet tab, view code and past this in. Text entered will be
changed to proper

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Formula = WorksheetFunction.Proper(Target.Formula)
End Sub

Mike
 
Thanks but I only want Title Case in cells B6, E6, B9, E9 & B15. Is this
possible?
 
maybe a bit to buggy, try this instead

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Target.Formula = WorksheetFunction.Proper(Target.Formula)
End Sub
 
Yes that's possible, try this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("B6, E6, B9, E9 ,B15")) Is Nothing Then
Target.Formula = WorksheetFunction.Proper(Target.Formula)
End If
End Sub

Mike
 
Thanks, it worked perfectly

Mike H said:
maybe a bit to buggy, try this instead

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Target.Formula = WorksheetFunction.Proper(Target.Formula)
End Sub
 

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

Back
Top