You don't need to worry about whatever the Data box shows, as that's disabled with the Custom option.
Note: You must enter the data validation formula for cell A2 first, then copy A2 to A3: A10 so that the second argument to the COUNTIF will match the current cell.
2) Detach the event hander before the unwanted event triggers and re-attach after. so when i click the add button the cell validating event triggers i have posted the cell validating event do you know how to solve this thanxxx code!!!
Something there is causing the cell validating event to fire. [Edit] The validating event is firing because focus is being moved from the DGV to the button.
How can I disable the cell validating event for the rows that was added before???
thankxxxxxx There are two ways to manage unwanted execution of event handlers.
Check out this video for a quick data validation overview.
You can download an example workbook with all of the data validation examples you'll find in this article.
Canceling this event cancels the changes to the current cell.
When this event is canceled in data bound mode, the new value is not pushed to the underlying data source.
The following Cell Validating Event Args properties provide information specific to this event.
Handle the Cell Validated event to perform post validation processing.
That is the A2)=1 portion will change to A3)=1, A4)=1 and so on.