I apologize if this is not clear.
I have two Modules. One called modFeeBasis and one called modWorksheetHoursBased. Located with each module are various sub routines (procedures). In modWorksheetHoursBased, I have a sub called ClearEnteredHoursOnHrsBased. In modFeeBasis, I have a sub called cmdButtonHoursBased.
I typically keep all my routines as "PRIVATE" so that they are not accessible to the user to call through the view macro window. And I have learned that the way to call a private sub that exists in another module is through the "APPLICATION.RUN" command. So if I wanted to call ClearEnteredHoursOnHrsBased from the cmdButtonHoursBased routine, my code shall read:
Application.Run "ClearEnteredHoursOnHrsBased"
And this works perfectly.
However, I would now like to pass a variable to the ClearEnteredHoursOnHrsBased routine. Something to the effect of:
Private Sub ClearEnteredHoursOnHrsBased(FromRadioButton As Boolean)
However, back at the cmdButtonHoursBased routine, I do not know how to pass the FromRadioButton argument from with the application.run command. The following doesnt work:
Application.Run "ClearEnteredHoursOnHrsBased(False)"
So - how do you pass arguments to private routines?
UPDATE: and everything works just fine if I remove the "PRIVATE" and just use:
ClearEnteredHoursOnHrsBased (True)
So I must be doing something right....but since I removed the PRIVATE, the routine is now accessible to the user from the View Macros window, which I dont want.
Bookmarks