View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Herrie Herrie is offline
external usenet poster
 
Posts: 5
Default Validation of 2 rows of cells, only 'X' or 'x' allowed.

Hello,

After roaming through the Search resluts on "Validation" I still have not
found a solution to my question.

I have a worksheet, that will be sent to a list of volunteers, who can mark
theu availability on this sheet by putting a "x" or "x" (a cross) in 2 rows
of cells.
(These rows are weekdays, morning/afternoon/evening)

I ONLY want an "X" (or "x") in these 2 x 21 cells.

I tried this snipet

[snippet]
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$19" Then
Debug.Print "oke"
Application.EnableEvents = False
Target.Text = Trim(Target.Value)
If Target.Text < "X" And Target.Value < "x" Then
MsgBox "Alleen aankruisen met een 'X' of een 'x'!"
Target.ClearContents
Target.Select
End If
Application.EnableEvents = True

End Sub
[/snippet]
on the first cell (D19) but nothing happens, no msgbox, nothing....

Where do I go wrong?

Any suggestions?

YT

Harry