Cell Formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to format a cell (C15 for example), so that whenever I enter a name
(e.g. "John Smith"), it is automatically converted to "Mr. John Smith". How
can I do that in Excel?
 
You can do that with this event sub, but what about women?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "C15" Then
Application.EnableEvents = False
Target.Value = "Mr. " & Target.Value
Application.EnableEvents = True
End If
End Sub

Regards,
Stefi


„Hi_no_Tori†ezt írta:
 
Thanks a lot Stefi. I tried the code and its working. As for women. There
are no women, so the code should be o.k. Thanks again Stefi. (^_^)
 
Back
Top