RESOLVED[Userform1 to userform2]
I have 2 userforms. In userform1 I entered some data through a combobox and stored it in a variable defined as a string. Then from userform1, once you've finished filling it, you pass to userform2.
How can you bring to userform2 the data from the combobox in userform1 stored in that variable?
Re: Userform1 to userform2
Place the variable declaration in a Module. Make it Public blah As String and it will be afvauilable to any userform or sheet.
Re: Userform1 to userform2
I created a module with:
VB Code:
Sub region()
Public region As String
End Sub
However, when I put in the userform
it happens to be an error. What am I doing wrong?
Re: Userform1 to userform2
Should be like this ...
VB Code:
Option Explicit
Public strRegion As String
Then to use anywhere:
VB Code:
Private Sub Command1_Click()
strRegion = "West Side!"
MsgBox strRegion
End Sub
Re: Userform1 to userform2
Sorry... I still don't get it. Where do I write Option Explicit?
Re: Userform1 to userform2
In a new standard Module. You can add it to your project if you dont have one by right clicking on the project file in the VBA IDE Project explorer and selecting Insert Module.