Sub function to show UserForm

后端 未结 2 2026
旧巷少年郎
旧巷少年郎 2021-02-06 14:40

I have an excel file with multiple UserForms. To open a UserForm I have code such as

Sub runAdjuster()
   Adjuster.Show
End Sub

There are about

2条回答
  •  别跟我提以往
    2021-02-06 14:50

    It depends on what launches these subs. If they are attached to a button or shape (which is what I tend to do for launching userforms) then it makes sense to put them in the module for the sheet that contains the shape. If buttons/shapes on several sheets refer to it -- put them in a general code module. I don't know if there really is a "best practice" here. The most important thing is to have consistency so that you don't have to go searching for things.

提交回复
热议问题