ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to call an event procedure (https://www.excelbanter.com/excel-programming/347458-how-call-event-procedure.html)

Ben

How to call an event procedure
 
Hi all,

I have button on a form. There's event code in the button click event. But
when certain conditions are met, I would like to call the button's click
event code. I know that I can take the code out of the click event and just
write a separate routine and have the click event call that routine, so that
I can also call the same routine when my conditions are met. But it's not my
code, so, I would like to just call the click event if possible. Any
suggestions? Thanks.

Ben

--


Norman Jones

How to call an event procedure
 
Hi Ben,

If the button code's declaration is changed to Public, then:

Call UserForm1.CommandButton1_Click

---
Regards,
Norman



"Ben" wrote in message
...
Hi all,

I have button on a form. There's event code in the button click event.
But
when certain conditions are met, I would like to call the button's click
event code. I know that I can take the code out of the click event and
just
write a separate routine and have the click event call that routine, so
that
I can also call the same routine when my conditions are met. But it's not
my
code, so, I would like to just call the click event if possible. Any
suggestions? Thanks.

Ben

--




Ben

How to call an event procedure
 
Thanks so much Norman.

Ben

--



"Norman Jones" wrote:

Hi Ben,

If the button code's declaration is changed to Public, then:

Call UserForm1.CommandButton1_Click

---
Regards,
Norman



"Ben" wrote in message
...
Hi all,

I have button on a form. There's event code in the button click event.
But
when certain conditions are met, I would like to call the button's click
event code. I know that I can take the code out of the click event and
just
write a separate routine and have the click event call that routine, so
that
I can also call the same routine when my conditions are met. But it's not
my
code, so, I would like to just call the click event if possible. Any
suggestions? Thanks.

Ben

--






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

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