0

I'm working on a simple Excel sheet, where users enter their first name, sometimes they don't use capital letters, so I'm trying to make the name cells capitalize first letter automatically when they fill in their name.

I tried PROPER formula but this is useful between 2 cells / columns.

When a user Enter "jose gonzalez" in the name cell and hit enter, the content become "Jose Gonzalez".

JvdV
  • 70,606
  • 8
  • 39
  • 70
  • Is VBA an option? – BigBen Sep 26 '19 at 13:26
  • 1
    @BigBen `When a user Enter "jose gonzalez" in the name cell and hit enter, the content become "Jose Gonzalez".` would require vba. A formula would need to be done in another cell from the one where the data was entered. – Scott Craner Sep 26 '19 at 13:31
  • 1
    Yep @ScottCraner I agree I just was confirming whether OP can actually use VBA (like if it's not blocked by corporate policy). – BigBen Sep 26 '19 at 13:34
  • Hi, yes i can use VBA formula. Thanks for the help. I need to apply the rule on a range of cells. D2:D1000 – Ludwig Arcache Sep 26 '19 at 14:05
  • You can combine [THIS](https://stackoverflow.com/questions/13860894/why-ms-excel-crashes-and-closes-during-worksheet-change-sub-procedure/13861640#13861640) and [THIS](https://stackoverflow.com/questions/19985895/convert-an-entire-range-to-uppercase-without-looping-through-all-the-cells/19986324#19986324) to get what you want ;) – Siddharth Rout Sep 26 '19 at 14:38

2 Answers2

4

Using the VBA editor (Alt + F11) in the Sheet module that you're working on, paste the following code

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Count > 1 Then
'more than one cell
Else
    If Target.Column = 5 Then
        If Len(Target) > 0 Then
            Application.EnableEvents = False
            Target = Application.WorksheetFunction.Proper(Target)
            Application.EnableEvents = True
        End If
    End If
End If
End Sub

Mine is using column E which is 5 so you would need to adjust accordingly.

0

The formula you're looking for is:

=PROPER(yourcell)

So, if you have written josE GonzalEz in A1, typing =PROPER(A1) will return a nice "Jose Gonzalez" in your cell :)

Pau
  • 61
  • 5