Hello!
What I have so far is a list of modules that have macros for a specific month. I made a userform with a combobox (name: SelectMonth) that lists the months for the user to select. The idea is to run the macro for the month that is selected, but I am getting "Compile error: Expected variable or procedure, not module." The code I am using is one that I found from another forum, but I'm not sure what I'm missing. Below is the code I am using.
The actual modules are named:
Bldg_InitialReconcilerCopy_June
Bldg_InitialReconcilerCopy_July
Bldg_InitialReconcilerCopy_Aug
And the macros are named:
June_Bldg_InitialReconcilerCopy
July_Bldg_InitialReconcilerCopy
August_Bldg_InitialReconcilerCopy
I tried to call it by the module name and macro name, but received the same error. If anyone can let me know what I need to do to fix it, I would greatly appreciate it!
What I have so far is a list of modules that have macros for a specific month. I made a userform with a combobox (name: SelectMonth) that lists the months for the user to select. The idea is to run the macro for the month that is selected, but I am getting "Compile error: Expected variable or procedure, not module." The code I am using is one that I found from another forum, but I'm not sure what I'm missing. Below is the code I am using.
The actual modules are named:
Bldg_InitialReconcilerCopy_June
Bldg_InitialReconcilerCopy_July
Bldg_InitialReconcilerCopy_Aug
And the macros are named:
June_Bldg_InitialReconcilerCopy
July_Bldg_InitialReconcilerCopy
August_Bldg_InitialReconcilerCopy
I tried to call it by the module name and macro name, but received the same error. If anyone can let me know what I need to do to fix it, I would greatly appreciate it!
VBA Code:
Private Sub CommandButton1_Click()
If SelectMonth.Value = "June" Then
Call Bldg_InitialReconcilerCopy_June
End If
If SelectMonth.Value = "July" Then
Call Bldg_InitialReconcilerCopy_July
End If
If SelectMonth.Value = "August" Then
Call Bldg_InitialReconcilerCopy_Aug
End If
End Sub