Hi Guys,
I have a simple message box, but I want to change it to one that has a checkbox with a "Do not remind me again" button. Any tips on it could be done?
The code I am using is pasted below. The Msg Box is the 4th last line of the code.
I have a simple message box, but I want to change it to one that has a checkbox with a "Do not remind me again" button. Any tips on it could be done?
The code I am using is pasted below. The Msg Box is the 4th last line of the code.
Code:
ub getResults()
ActiveSheet.Unprotect Password:="Syncos123!"
Sheets("selector").Activate
Dim resultDrop As Range
Set resultDrop = Sheets("Selector").Range("A12")
Dim outcomeDrop As Range
Set outcomeDrop = Sheets("Selector").Range("A24")
Dim dOutcomeSelect As String
dOutcomeSelect = Sheets("Selector").Range("A8").Value
'Sheets("Master List").Activate
Dim dOutcomeList As Range
Set dOutcomeList = Sheets("Master List").Range("C2:BD4")
Dim masterRange As Range
Set masterRange = Sheets("Master List").Range("C2:BD28")
Dim dOutcomePos As Range
Set dOutcomePos = masterRange.Find(dOutcomeSelect)
'Exit Sub
'On Error GoTo ErrorHandler
'ErrorHandler:
'MsgBox "You cannot paste information. Press ctrl+Z to undo, and then select from the drop-down menu again"
'Resume Next
Dim resultQuant As Long
resultQuant = dOutcomePos.Offset(2, 0).Value
Dim outcomeQuant As Long
outcomeQuant = dOutcomePos.Offset(2, 1).Value
Dim resultRange As Range
Set resultRange = Range(dOutcomePos.Offset(3, 0), dOutcomePos.Offset(resultQuant + 2, 0))
Dim outcomeRange As Range
Set outcomeRange = Range(dOutcomePos.Offset(3, 1), dOutcomePos.Offset(outcomeQuant + 2, 1))
ActiveWorkbook.Names.Add Name:="ValListR", RefersTo:=resultRange
ActiveWorkbook.Names.Add Name:="ValListO", RefersTo:=outcomeRange
With resultDrop.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=ValListR"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
With outcomeDrop.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=ValListO"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
resultDrop.Value = resultRange(1, 1).Value
outcomeDrop.Value = outcomeRange(1, 1).Value
MsgBox "The 'Results' and 'Outcomes' have been updated based on your selection of the 'Desired Outcome'. Please select the applicable Result and Outcome from the drop-down menu and copy it using the button before pasting it into GAIMS."
ActiveSheet.Protect Password:="Syncos123!", DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub