AndyGalloway
Board Regular
- Joined
- Apr 24, 2019
- Messages
- 51
This is a very small query and I have identified a few solutions myself, but I'm sure there must be something even easier, I just can't figure how to make that happen.
In a sheet, when a cell in Column A is selected (personnel name) I load the cell contents into a variable. If the "Delete" key is pressed on the keyboard, I use the change event to display a MessageBox asking if they are sure. If "Yes" follow a whole delete routine. If "No" write the variable back into the cell and display a message "Name reinstated". If I move elsewhere on the sheet and come back to this cell, this code is fine. However, if I remain in the same cell i.e. don't select that cell again, and then press the "Delete" key on my keyboard for a second time, then the Change event is not fired and so the delete routine doesn't get followed.
Question: Is there a way to trigger the Change event a second time on the same cell? My original thought is to just focus on another cell and then back to this one again. That doesn't seem very elegant. Do you have a better solution?
In a sheet, when a cell in Column A is selected (personnel name) I load the cell contents into a variable. If the "Delete" key is pressed on the keyboard, I use the change event to display a MessageBox asking if they are sure. If "Yes" follow a whole delete routine. If "No" write the variable back into the cell and display a message "Name reinstated". If I move elsewhere on the sheet and come back to this cell, this code is fine. However, if I remain in the same cell i.e. don't select that cell again, and then press the "Delete" key on my keyboard for a second time, then the Change event is not fired and so the delete routine doesn't get followed.
Question: Is there a way to trigger the Change event a second time on the same cell? My original thought is to just focus on another cell and then back to this one again. That doesn't seem very elegant. Do you have a better solution?