I have an Excel sheet in which the user drags a cell in column A to any cell in column B. Each of the cells in column B has a random integer. If the user drags a cell in Column A to a cell in Column B that has an odd number I want to show a message and undo the operation. It's OK to drag and drop to a cell with an even integer but not an odd integer.
Using VBA I can capture the address and value of the cell in Column A that is being dragged, and the address of the destination cell in Column B. But I don't know how to capture the initial value in Column B before it is replaced by the value that is dragged/dropped.
Please let me know if it is possible to do either of these:
- capture the value being replaced (so I can restore it if I wish to undo the drag and drop)
- simply undo the drag and drop operation (restore the values in the two cells)
Thanks.
Bookmarks