Do the cells on Excell worksheets have events ie. OnEnter, OnChange, OnExit etc? I have to create a worksheet in which users enter names of things along with various information about the named items. The Names column is the key field. When the user enters a name in that field, I need to check the entire column to be sure the name doesn't already exist and prevent the user from exiting the cell (or row) if a match is found.
When I go into the macro help and look for On Exit, I do get a write up on the following
Private Sub object_Exit( ByVal Cancel As MSForms.ReturnBoolean)
I am trying to use the named range for that column as the object.
However, when I try to go past AS within the parenthasis, all the available choices that start with MS are followed by o. There are no MSForms available in the drop down selection. I have not been able to figure out how to make this work. I'm am using Excel 2007. How can I trigger a sub when the use exits the cell?
(I thought I found a solution by creating a hidden column with the COUNTIF function and then setting the data varfication for my named range to requiring a value of <2 int the corresponding cell of the hidden column. This works if the user uses TAB or ENTER to exit the cell, but if he clicks on another cell with the mouse it doesn't work. Furthermore, if the user mouses out and then goes back to the offending cell and tries to get out using TAB or ENTER he is able to exit without triggering the data validation violation.)
When I go into the macro help and look for On Exit, I do get a write up on the following
Private Sub object_Exit( ByVal Cancel As MSForms.ReturnBoolean)
I am trying to use the named range for that column as the object.
However, when I try to go past AS within the parenthasis, all the available choices that start with MS are followed by o. There are no MSForms available in the drop down selection. I have not been able to figure out how to make this work. I'm am using Excel 2007. How can I trigger a sub when the use exits the cell?
(I thought I found a solution by creating a hidden column with the COUNTIF function and then setting the data varfication for my named range to requiring a value of <2 int the corresponding cell of the hidden column. This works if the user uses TAB or ENTER to exit the cell, but if he clicks on another cell with the mouse it doesn't work. Furthermore, if the user mouses out and then goes back to the offending cell and tries to get out using TAB or ENTER he is able to exit without triggering the data validation violation.)