undo in code

L

lrisser

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

R. Choate

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


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.
 
G

Greg Wilson

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
 
R

R. Choate

I think this OP has not used the normal data validation provided and has
built their own with code. They said they wrote a function. I guess that
will keep them from going the easy route. Makes you wonder if they could
have used the normal validation techniques.
--
RMC,CPA


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top