Estimated reading time: 3 minutes

Function Summary

The ReportMacro function executes a designated VBA macro when triggered upon a designated event.

For an example of this function, see Lab Create: Using Report Macro

Function Arguments

Type String
Constraints "pull", "save", "both"
If Blank Function Error

Type String
Constraints "clear", "run", "both"
If Blank Function Error

Type String
Constraints Macro in VBA cannot contain parameters
If Blank Will Error

Excel Formula Bar Example


Function Composition

Argument Name Example Mapping Explanation
Function Name =ReportMacro() The name of this function.
OnPullSaveOrBoth "Pull" A pull action is designated as the run event.
OnClearRunOrBoth "Both" A clear event or run event (defined in OnPullSaveOrBoth) will trigger this macro being ran.
MacroNameToRun "MyCustomFunction" The macro "MyCustomFunction" will be ran.

Trigger Combination List

The execution of this function is determined by a combination of an Interject action and an Interject event. An action is a pull or save action whereas an event is a clear or run event. The values in the OnPullSaveOrBoth and OnClearRunOrBoth arguments will determine what actions/events trigger the function's execution.

Trigger Combo OnPullSaveOrBoth OnClearRunOrBoth Event Function Executes On
1 Pull Clear Pull-Clear
2 Save Clear Save-Clear
3 Both Clear Pull-Clear, Save-Clear
4 Pull Run Pull-Run
5 Save Run Save-Run
6 Both Run Pull-Run, Save-Run
7 Pull Both Pull-Run, Pull-Clear
8 Save Both Save-Run, Save-Clear
9 Both Both Pull-Run, Pull-Clear, Save-Run, Save-Clear