Organize Macro's

Hello,

What is the best way to organize macro’s?

I want to put a macro on all forms when opening the document. Some of them will be using the same macro, so I want to reuse the code.

Let’s say I have macro1, macro2, macro3

Form1 should use macro1 and macro3

Form2 should use macro2 and macro3

Form3 should use macro1, macro2 and macro3

Can I create a macro which uses the code from macro1 and macro3

Another macro which uses the code from macro2 and macro3

And another that uses code from macro1, macro2 and macro3

Hello,

Just create a “Sub” containing the appropriate calls.

Using your examples for Form1:

Sub Form1Opening
    macro1
    macro3
End Sub

This is exactly what I was looking for.