View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid vezerid is offline
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