View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Advanced Formatting

Hi

No can do with formatting. Macro work. Rightclick the sheet tab, choose
"view code", paste the following into the blank moule:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim L As Long
With Target(1)
L = Val(.Value)
Application.EnableEvents = False
Select Case L
Case 0
.Value = "No kids"
Case 1
.Value = L & " Child"
Case Else
.Value = L & " Childs"
End Select
Application.EnableEvents = True
End With
End Sub

HTH. Best wishes Harald

skrev i melding
oups.com...
Does anybody know how to apply a special formatting to a cell in a way
that if "1" was typed in it it will display "1 Child" but if 2 or 3 or
4 was typed it shows "2 Childs" or "3 Childs" ....

Thank you