I am using the following code to open a userform. Once the userform is open, the user has the option to choose a continue button or a cancel button. If the user is choosing continue, the code is not working (it always skips to the "else" portion of my "if" statement. I can't figure out why it is doing this. Thanks. I have attached a sample of workbook, if needed.
Sub UpdateMasterFile()
Dim Continue As String
Load DisclaimerForm
DisclaimerForm.Show
If Continue = "Yes" Then
'do some updates
MsgBox "Update Complete! ", vbInformation
Else
MsgBox "Update Canceled! ", vbInformation
End If
End Sub
Userform code:
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
ContinueButton.Enabled = True
Else
ContinueButton.Enabled = False
End If
End Sub
Private Sub ContinueButton_Click()
Unload DisclaimerForm
Continue = "Yes"
End Sub
Private Sub CancelButton_Click()
Unload DisclaimerForm
Continue = "No"
End Sub
Bookmarks