Hi,

I’m trying to create an Excel VBA userform to manage some parking slots and I would need to verify if, on a specific date, a parking space is already attributed and/or if a specific car plate already has a place.

For that, I need a VBA routine that informs and prevents users from entering duplicate data.

When the user clicks on the insert button, the program should verify column C (date in text format). If the value (date) already exists, it should then verify column D (plate n°) and/or column E (parking n°); should any of these latter values match an existing record, the program should inform the user that the entry already exists and prevent him from inserting it.


id_____name________date_________plate n°___parking n°
1______Joao______02/10/2011______XXX______-1/009
2______Pedro_____03/11/2011______YYY______-1/010
3______Luis______02/10/2011______ZZZ______ -1/009
3______Pedro_____15/10/2011______XXX______-1/012


Thanks for your help!