Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default Use custom format to add text to a text entry.

How might I place a text string in a cell such as "Bell & Howell", and
have the cells contents display: "CUSTOMER: Bell & Howell".

Looks like custom format requires a number. Usine Excel 2003.

TIA for your thoughts.
Pierre

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Use custom format to add text to a text entry.

The following OnChange event procedure in your sheet can do this.

Private Sub Worksheet_Change(ByVal Target As Range)
If __cond__ Then
Application.EnableEvents = False
Target.Value = "CUSTOMER: " & Target.Value
Application.EnableEvents = True
End If
End Sub

Important: __cond__: It will be a condition that tests if this is a
cell in which you want the autochange. Depending on which cells you
want this to hold for the condition will change. If you want this to
hold for the entire sheet just remove the If line and the End If line.

To install: right-click on the sheet tab. Choose View Code... In the
resulting window paste the above code. Example condition:

If not intersect(target,range("A:C") is nothing then

This will only allow the code to fire for cells in columns A:C

Does this help? Write back for exact condition if necessary.

HTH
Kostis Vezerides


Pierre wrote:
How might I place a text string in a cell such as "Bell & Howell", and
have the cells contents display: "CUSTOMER: Bell & Howell".

Looks like custom format requires a number. Usine Excel 2003.

TIA for your thoughts.
Pierre


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default Use custom format to add text to a text entry.


vezerid wrote:
The following OnChange event procedure in your sheet can do this.

Private Sub Worksheet_Change(ByVal Target As Range)
If __cond__ Then
Application.EnableEvents = False
Target.Value = "CUSTOMER: " & Target.Value
Application.EnableEvents = True
End If
End Sub

Important: __cond__: It will be a condition that tests if this is a
cell in which you want the autochange. Depending on which cells you
want this to hold for the condition will change. If you want this to
hold for the entire sheet just remove the If line and the End If line.

To install: right-click on the sheet tab. Choose View Code... In the
resulting window paste the above code. Example condition:

If not intersect(target,range("A:C") is nothing then

This will only allow the code to fire for cells in columns A:C

Does this help? Write back for exact condition if necessary.

HTH
Kostis Vezerides




Kostis:
Thank you for the reply, still a little fuzzy. . .

Need it to fire in cell E3

(Other texts in different cells, but I can get there once I load this
one.)
Thanks again.

Pierre

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 340
Default Use custom format to add text to a text entry.

Use the custom number format:
"Customer: "@

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default Use custom format to add text to a text entry.


Lori wrote:
Use the custom number format:
"Customer: "@


Got both working fine. Thanks so much.

Pierre

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
Conversion to Text file format error Rob Excel Discussion (Misc queries) 1 June 26th 06 10:33 AM
Convert Text Entry to Date Format User Excel Discussion (Misc queries) 1 November 16th 05 08:40 PM
Custom format with text PierreL Excel Discussion (Misc queries) 2 October 14th 05 06:46 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
Keep custom format in new worksheet Buddy Excel Discussion (Misc queries) 2 March 14th 05 10:03 AM


All times are GMT +1. The time now is 11:50 PM.

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

About Us

"It's about Microsoft Excel"