Ask Your Question
0

Organize Macro's

asked 2020-06-05 19:35:37 +0200

Tripple Delta gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2020-06-05 21:24:13 +0200

Ratslinger gravatar image

Hello,

Just create a "Sub" containing the appropriate calls.

Using your examples for Form1:

Sub Form1Opening
    macro1
    macro3
End Sub
edit flag offensive delete link more

Comments

This is exactly what I was looking for.

Tripple Delta gravatar imageTripple Delta ( 2020-06-06 11:53:29 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-06-05 19:35:37 +0200

Seen: 21 times

Last updated: Jun 05