ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   undo in code (https://www.excelbanter.com/excel-programming/274070-undo-code.html)

lrisser

undo in code
 
I've written a function that validates whether data entry
into a cell matches a list of approved entries, and brings
up a message box to tell the user of an invalid entry. I
would also like the code to undo the last entry. I've
tried using sendkeys "^Z" but that doesn't seem to do it.
Any suggestions.

thanks in advance.


R. Choate

undo in code
 
You can't do an undo for actions carried out by code. The best you could do
is write a macro that can do the opposite of the other macro.
--
RMC,CPA


"lrisser" wrote in message
...
I've written a function that validates whether data entry
into a cell matches a list of approved entries, and brings
up a message box to tell the user of an invalid entry. I
would also like the code to undo the last entry. I've
tried using sendkeys "^Z" but that doesn't seem to do it.
Any suggestions.

thanks in advance.



Greg Wilson[_3_]

undo in code
 
If you mean undo the last entry if it wasn't an approved
entry then isn't the Data Validation utility tailor made
for this? No need for the custom macro either.

Regards,
Greg


-----Original Message-----
I've written a function that validates whether data entry
into a cell matches a list of approved entries, and

brings
up a message box to tell the user of an invalid entry. I
would also like the code to undo the last entry. I've
tried using sendkeys "^Z" but that doesn't seem to do it.
Any suggestions.

thanks in advance.

.



All times are GMT +1. The time now is 02:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com