Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Herrie
I suspect that Application.EnableEvents is set to false, as you probably crashed after switching it off. In the Immediate window, type Application.EnableEvents followed by return You aslo have an End If missing (from your first If statement) To cover all of the cells in your range, use something like Private Sub Worksheet_Change(ByVal Target As Range) Dim myRng As Range Set myRng = Range("D19:J22")' Change to suit If Not Intersect(Target, myRng) Is Nothing Then Debug.Print "oke" Application.EnableEvents = False If Target.Text < "X" And Target.Value < "x" Then MsgBox "Alleen aankruisen met een 'X' of een 'x'!" Target.ClearContents Target.Select End If End If Application.EnableEvents = True End Sub -- Regards Roger Govier "Herrie" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you limit the total allowed for a group of cells? | Excel Discussion (Misc queries) | |||
Maximum Allowed Rows | Excel Discussion (Misc queries) | |||
Total rows allowed on spreadsheet 2007 version | Excel Worksheet Functions | |||
How do increase the number of rows allowed in a worksheet? | Excel Discussion (Misc queries) | |||
Pivot Table - max rows allowed in data range | Excel Discussion (Misc queries) |