Hi ...
I have a routine that runs continuously and needs to loop through half a dozen worksheets, perform some arithmetic, and then wait for a while before starting again.
I am able to employ Application.ScreenUpdating = False to prevent the display changing while the routine is running, but focus goes to the last sheet altered by the routine when the loop completes.
I would like to return the focus to the sheet that I was viewing when the loop starts, rather than having to reselect it.
How do I assign a variable xxx to the name of the worksheet that was displayed when the loop starts so that I can return to that sheet using something like Worksheets(xxx).Select when the loop finishes?
I have a routine that runs continuously and needs to loop through half a dozen worksheets, perform some arithmetic, and then wait for a while before starting again.
I am able to employ Application.ScreenUpdating = False to prevent the display changing while the routine is running, but focus goes to the last sheet altered by the routine when the loop completes.
I would like to return the focus to the sheet that I was viewing when the loop starts, rather than having to reselect it.
How do I assign a variable xxx to the name of the worksheet that was displayed when the loop starts so that I can return to that sheet using something like Worksheets(xxx).Select when the loop finishes?