#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Cell Formatting

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Cell Formatting

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:

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?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Cell Formatting

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. (^_^)

"Stefi" wrote:

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:

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?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Cell Formatting

You are welcome! Thanks for the feedback!
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. (^_^)

"Stefi" wrote:

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:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formatting if value in cell is found in a named range Grumpy Grandpa Excel Worksheet Functions 5 April 15th 06 04:30 PM
Cell Formatting Conditional On Other Cells Fill Color? [email protected] Excel Worksheet Functions 1 April 5th 06 10:05 PM
Conditional Formatting For A Cell Other Than The One With The Form Jim J. Excel Worksheet Functions 2 February 19th 06 07:11 PM
Transfer Cell Formatting for linked cells Scott Excel Discussion (Misc queries) 2 November 23rd 05 11:04 PM
xls worksheet formatting a single cell Archer------------> Excel Discussion (Misc queries) 1 April 30th 05 07:25 PM


All times are GMT +1. The time now is 06:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"