ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to activate form button (https://www.excelbanter.com/excel-programming/297974-re-macro-activate-form-button.html)

kkknie[_90_]

Macro to activate form button
 
I don't know of a way to simulate the clicking of a forms toolbar butto
so that the Application.Caller shows up as the button name, but I hav
another suggestion.

1. Create a global variable in a standard module:

Public gbln_ExitOK As Boolean

2. Set it to False in your Workbook_Open event procedure.
3. Set it to True when you button is clicked or when the macro runs.
4. Check for it to be true instead of checking Application.Caller



--
Message posted from http://www.ExcelForum.com


James Stephens[_2_]

Macro to activate form button
 
Thanks, that worked great, and was a much easier way to go about thanks

Thanks again

Ji

----- kkknie wrote: ----

I don't know of a way to simulate the clicking of a forms toolbar butto
so that the Application.Caller shows up as the button name, but I hav
another suggestion

1. Create a global variable in a standard module

Public gbln_ExitOK As Boolea

2. Set it to False in your Workbook_Open event procedure
3. Set it to True when you button is clicked or when the macro runs
4. Check for it to be true instead of checking Application.Calle




--
Message posted from http://www.ExcelForum.com




All times are GMT +1. The time now is 06:46 AM.

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