Message 1 of 19
Passing Var's from Userform to Module
Not applicable
12-11-2005
10:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How can i pass a variable from my userform to a sub in another module.
I have a userform with a listbox and a command button
The user will select an item in the listbox and then click the command button which will call a sub from another module.
So in my userform i have this......
Private Sub Listbox1_Click
Var1 = 10
Var2 = 11
End Sub
Private sub CommandButton1_Click
Me.Hide
Call DrawItem
Me.Show
End Sub
Now in Module1 i have the sub DrawItem
Public Sub DrawItem ()
Var1 = NumbofItems
Var2 = NumbofPieces
End Sub
So i need to pass Var1 and Var2 from my userform to the sub in module1.
Any Help. Thanks in advance.
I have a userform with a listbox and a command button
The user will select an item in the listbox and then click the command button which will call a sub from another module.
So in my userform i have this......
Private Sub Listbox1_Click
Var1 = 10
Var2 = 11
End Sub
Private sub CommandButton1_Click
Me.Hide
Call DrawItem
Me.Show
End Sub
Now in Module1 i have the sub DrawItem
Public Sub DrawItem ()
Var1 = NumbofItems
Var2 = NumbofPieces
End Sub
So i need to pass Var1 and Var2 from my userform to the sub in module1.
Any Help. Thanks in advance.