Reputation: 1340
I am new to Excel macro, I try to write a testing macro named Test without parameter, and then in Excel workbook, press the macro button, the testing macro is shown as follow:
but if I add a parameter to the macro Test as
Public Sub Test(var1 As String)
then when I return to the workbook, press the macro button, the Test macro is not shown, why? Is macro cannot with parameter?
Upvotes: 0
Views: 260
Reputation: 27239
The macro is not shown because you have forced a parameter to be passed as part of the procedure, thus rendering the procedure unavailable to be run on a stand-alone basis.
Upvotes: 1