Linked Questions
12 questions linked to/from Passing variable from Form to Module in VBA
14 votes
3 answers
9k views
VBA - destroy a modeless UserForm instance properly
Intro: I am aware that - showing UserForms - it's best practice to handle QueryClose within the userform code (If CloseMode = vbFormControlMenu ...) doing no Unload Me therein, just a timid Me.Hide ...
2 votes
2 answers
7k views
VBA how to pass userform variables to subroutine
I am trying to use a subroutine call a variable from a userform input. But, even though I can display the userform inputs correctly in the userform by printing it to the sheet, I can't seem to pass it ...
3 votes
2 answers
4k views
VBA Automation Error - "server [not server application]" upon closing form
I've tried creating a form in the object-oriented manner as shown in this answer: https://stackoverflow.com/a/38382104/4460023. Upon closing the form, I'd like to refer to the object property ...
2 votes
4 answers
3k views
Assigning a variable directly from a userform
I am trying to add some code to have a userform pop up which allows the end user to input their login/password for s specific website. This code Passing variable from Form to Module in VBA got me ...
1 vote
3 answers
2k views
Treat Userform as a Function
I have created a VBA UserForm which is essentially a glorified input box Just like an input box can be employed like this Dim returnVal As String returnVal = InputBox("Write some string") I would ...
1 vote
0 answers
3k views
Select Outlook folder using path
I have a vast number of folders in my Outlook inbox. I have a macro which will list (in a listbox object) all the folders that have xxxx text in it. I then manually drill down into the folder ...
0 votes
1 answer
1k views
Variant array passed from UserForm to Module in VBA is null/empty
I have a UserForm with a ListBox for the user to select values. Those values are populated in UserForm_Initialize() via a function call to the base module, which returns an array as variant. This ...
0 votes
1 answer
1k views
Assign UserForm inputs to variables in new module VBA
I want to assign the inputs of a userform to variables in a new module once the user clicks submit. I have read the following post : Passing variable from Form to Module in VBA I believed I had ...
0 votes
1 answer
309 views
Creating variable in userform and moving it to a module
I'm new to VBA and and am trying to finish this project by teaching myself. I'm trying to make a userform with a ComboBox drop down menu of months and a textbox to enter the year. I then want to have ...
0 votes
0 answers
189 views
VBA Unload Userform triggers Private Sub UserForm_Initialize()
I have code where on the first try it works fine. The code ends with 710 Unload UserForm1 730 Unload UserForm2 On the first round, these trigger: Private Sub UserForm_QueryClose(Cancel As ...
1 vote
1 answer
119 views
How do I send the email object to a function?
If have a function that loops through a selection of emails, an email is an object not a lose variable (Passing variable from Form to Module in VBA): Private Sub CommandButton5_Click() For Each ...
-2 votes
1 answer
58 views
Allowing all classes within a project access to a form
I am currently designing a project with a windows form. I am also creating classes that I want to interact with this form. Instead of passing through the form to each object I create, is there a way ...