0 votes
in VBA by Beginner (23 points)

Are all event macros private sub? Or are there any event macros which are public sub?

1 Answer

0 votes
by Skilled (401 points)
That returns to your needs

Sometimes you need to create a macro for specific module only so you make it Private

But if you need to make other modules to see that macro or you need to call it from other modules, you have to make it public.
by Beginner (23 points)
You mean to say event macros can be public sub?
by Skilled (401 points)
Worksheet events are private and also Workbook_Open event ..

But I think you can call those events with special ways
by Beginner (23 points)
My question still survives:

Are all event macros private sub?
by Skilled (401 points)
I think all event macros are private by default..

Welcome to wellsr Q&A
wellsr Q&A is the VBA and Python programming community that rewards you for learning how to code.

Earn free prizes for asking VBA and Python questions and for answering questions asked by others in our community.

What makes us different?
Our points system rewards you with a chance for free gifts based on the quality of your questions and/or answers. Users that ask great questions, may be given complimentary gift cards or training material.

Getting Started
Register

So, why don't you join us? It really is a neat way to reward the most dedicated members in our VBA and Python community.

For more programming tips visit the VBA Tutorials Blog and the Python Tutorials Blog.

...