Execute a module

  • Thread starter Thread starter A E
  • Start date Start date
A

A E

Hi,

I don't understand how to call a module that is working properly from a
macro or a button in a form.

How do I link it to where I want it to run?

Many thanks in advance / A E
 
A said:
Hi,

I don't understand how to call a module that is working properly from
a macro or a button in a form.

How do I link it to where I want it to run?

Many thanks in advance / A E

Technically you don't call a module. The module contains subs and/or
functions and you can call those. In VBA code you can call both subs and
functions directly by name. A macro can only call a function.

EX: if your sub was..

Sub SomeSub
(some code here)
End Sub

....You would use...

Call SomeSub
....or just...
SomeSub

If you made it a function instead...

Function SomeFunction
(some code here)
End Function

....then you can just use...

=SomeFunction()

....in your event property.
 
Back
Top