View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
papou[_3_] papou[_3_] is offline
external usenet poster
 
Posts: 31
Default Entering a certain text automatically

Hello Teija
Do you want this behaviour for any Excel sheet or for just one specific
sheet?
if the latter:
right-click on the sheet tab, select View code and paste this:
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Text
Case Is = "f"
Application.EnableEvents = False
Target.Value = "free"
Application.EnableEvents = True
Case Is = "s"
Application.EnableEvents = False
Target.Value = "sick"
Application.EnableEvents = True
End Select
End Sub

HTH
Cordially
Pascal

"Teija" a écrit dans le message de news:
...
I have a simple? problem that I can't solve. If I enter "f", I want that
Excel enters word "free" automatically in that same cell and if I enter
"s",
Excel enters "sick" and so on. This has to happen everywhere in the
spredsheet. (Enable AutoComplete for cell values isn't enough). The data
should be in a common cell. Can anyone help me?
--
Thankful for your help!