I have a macro that needs to run for update.
If Excel is in edit, I need a macro to have Excel exit edit mode, that is, take control.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The natural way to do this is by using the Application.OnTimer method, but it has the “edit problem” you just noted. The called function will not get executed until the user leaves the edit mode.
You may overcome this: This solution is not very efficient, but you may yield control from a macro and regain it from a timer (or any other event you choose).
The following code is from the Excel timer function help.
While the timer is counting down (or you are awaiting other event), you can continue working on your worksheet.
You should invoke this macro beforehand, perhaps at the open workbook event.
Also, it is possible to keep the loop going, repeating the update when you want to.
You should check if this strategy does not interfere with other features used in your particular worksheet.