0 votes
in VBA by Beginner (123 points)

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

1 Answer

0 votes
by Skilled (306 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 (123 points)
You mean to say event macros can be public sub?
by Skilled (306 points)
Worksheet events are private and also Workbook_Open event ..

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

Are all event macros private sub?
by Skilled (306 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 as your contributions grow. The more points you earn, the better the prizes.

Getting Started
Register
Prizes

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

Top Users Mar 2019
  1. YasserKhalil

    306 Points

  2. ParserMonster

    204 Points

  3. Alberto Semat

    186 Points

  4. danmcg

    127 Points

  5. Abdan

    124 Points


Prizes for March 2019
Terms and Conditions
1st place (1) 1-year MyExcelOnline Academy Membership
(2) My First Add-in Dev Pack & Course
(3) AutoMacro: VBA Code Generator (Developer)
(4) VBA Cheat Sheet Bundle
(5) $35 Amazon Gift Card
2nd place (1) My First Add-in Dev Pack & Course
(2) 101 Most Popular Excel Formulas E-Book
(3) VBA Cheat Sheet Bundle
(4) $25 Amazon Gift Card
3rd place (1) Mouse to Macro
(2) VBA Cheat Sheet Bundle
(3) $15 Amazon Gift Card
...