Cancel Cell Edit

In a listbox that is editable, after you have edited a cell the cell action event fires.
I pop up a dialog box asking if the user wants to accept the edit. Yes / No stuff…
If no I want to revert the cell back to its original contents.
If during an edit you press the esc key the cell contents are reverted for you ‘free’ of charge so to speak…
So… How might I do this without saving the cell contents myself prior to the edit etc?
Seems like there must be a hook i’m missing.

I think that you’ll have to save and restore the original value if the user wants to revert from the dialog box. As I understand it, the CellAction event fires after the cell’s contents have been changed and “accepted” by the listbox. At that point, the cell’s original contents are gone so, to restore the original value, you’ll have had to save it and put it back yourself.

You could try to use the CellLostFocus event instead. I think that happens before the cell contents are changed. You could grab listbox.Cell(row,column) and stick it back into listbox.ActiveCell.Text.