Declaring a UserForm listbox as a variable in a module? Excel VBA
<p>Alright this is my first post on here so be gentle.</p>

<p>I have a Userform with a listbox containing x amount of values. I have a separate module that calls this Userform and then performs some procedures based on the values chosen in the listbox. I have the following:</p>

<pre><code>Dim lb as ListBox

lb = Userform1.Listbox1
For x = 0 to lb.ListCount - 1 Then
    'Do the stuff I need it to
Next x
</code></pre>

<p>The problem I am getting is that lb returns a "Nothing". </p>

<p>I am sure this is something simple but I can't figure it out. Appreciate the help.</p>