Hi All, I have a userform which has two variable and I want to use those variable values in multiple Modules
'Userform Submit Code
Private Sub SubmitButton_Click()
If Me.ComboBox1.Value = "" Then
MsgBox "Please Enter Period Value"
ElseIf Me.ComboBox2.Value = "" Then
MsgBox "Please Enter Fiscal Year"
ElseIf Me.ComboBox1.Value <> "" And Me.ComboBox2.Value <> "" Then
Period = Me.ComboBox1.Value
FY = Me.ComboBox2.Value
Unload Me
End If
End Sub
******************Below is my Module*****
Public Period As String
Public FY As String
Sub MyModule()
Period = 'Here i want userform Period value
FY = 'Here i want userform FY value
End Sub
Thanks in advance
'Userform Submit Code
Private Sub SubmitButton_Click()
If Me.ComboBox1.Value = "" Then
MsgBox "Please Enter Period Value"
ElseIf Me.ComboBox2.Value = "" Then
MsgBox "Please Enter Fiscal Year"
ElseIf Me.ComboBox1.Value <> "" And Me.ComboBox2.Value <> "" Then
Period = Me.ComboBox1.Value
FY = Me.ComboBox2.Value
Unload Me
End If
End Sub
******************Below is my Module*****
Public Period As String
Public FY As String
Sub MyModule()
Period = 'Here i want userform Period value
FY = 'Here i want userform FY value
End Sub
Thanks in advance