1
votes

I added a VBA Form userform and a Module Module1 in a Excel by opening the Microsoft VBA editor (Alt+F11) from the Excel.

Now, whenever I open any other Excel, pressing Alt+F11 takes me to the VBA editor and shows up that userform and the Module1.

The userform and Module1 is basically getting tied to every Excel sheet I open?
What am I doing wrong?
How do I make sure my form is attached to the particular Excel sheet only and not others?

1
Does this hold true if you close all excel documents and open a new, empty one? - David G

1 Answers

3
votes

No, every userform/module is saved in one Excel file/project. But because there is only one VBA editor for all opened workbooks, you see the VBA codes of all open workbooks in one VBA editor.

Have a look into the Project Explorer of your VBA editor: Here you see the VBA codes (and userforms and modules) of all worksheets that are open at that time. And you can see which module/userform belongs to which Excel file/project.