ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reseting A Spreadsheet (https://www.excelbanter.com/excel-programming/291802-reseting-spreadsheet.html)

Paul

Reseting A Spreadsheet
 
What VBA command is equivalent to pressing the "esc" key? Or what other code should I place at the end of a macro to "reset" the worksheet so that the menu bar buttons will show again?

Ron de Bruin

Reseting A Spreadsheet
 
Hi Paul

Please more information

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Paul" wrote in message ...
What VBA command is equivalent to pressing the "esc" key? Or what other code should I place at the end of a macro to "reset"

the worksheet so that the menu bar buttons will show again?



Paul

Reseting A Spreadsheet
 
Ron,

sometimes when I run macros, while the macro has control of the worksheet, many of the buttons on my tool bar are grayed out so that they cannot be selected. Once the macro ends, those buttons usually reapper in full color indicating they can be selected.

Every now and then when I run a macro, control does not seem to be entirely restrored to the worksheet upon the macro finishing. HOWEVER, the moment I push the "esc" key, or left click my mouse, or perform a cut & paste, everything reverts back to normal and the toolbar buttons appear ready for selection. I was just wondering if I could put one last line in any macro that I experience this minor annoyance with to save me from having to perform the final keystroke manually.

Hope this helps,
Paul

Gord Dibben

Reseting A Spreadsheet
 
Paul

You have some other issue which leads to the "non-restoration" at the end of
your macros.

That should be addressed first.

That said, if the Esc key restores, try this at end of macro.

SendKeys "{ESC}"

Gord Dibben Excel MVP



On Wed, 18 Feb 2004 16:01:06 -0800, "Paul"
wrote:

Ron,

sometimes when I run macros, while the macro has control of the worksheet, many of the buttons on my tool bar are grayed out so that they cannot be selected. Once the macro ends, those buttons usually reapper in full color indicating they can be selected.

Every now and then when I run a macro, control does not seem to be entirely restrored to the worksheet upon the macro finishing. HOWEVER, the moment I push the "esc" key, or left click my mouse, or perform a cut & paste, everything reverts back to normal and the toolbar buttons appear ready for selection. I was just wondering if I could put one last line in any macro that I experience this minor annoyance with to save me from having to perform the final keystroke manually.

Hope this helps,
Paul



Paul

Reseting A Spreadsheet
 
Gordon

This does it. Thank you very much

Paul


All times are GMT +1. The time now is 01:50 PM.

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