i have a macro that runs every time external data is pulled into a spreasheet and would like a message box to pop up telling the user which of the multiple different control totals do not tie out. my current code works, but it makes a seperate message box each total that does not tie.....is there a way to include all the checks that do not match in one msg box.... is "check1, check2 and check3 are not equal" instead of "check1 is not equal", "check2 is not equal" and "check3 is not equal"
here is my current code"
Sub check()
If check0 = truecheck Then
MsgBox "control totals tie out"
ElseIf check1 <> trucheck Then
MsgBox "check 1 is not equal"
ElseIf check2 <> trucheck Then
MsgBox "check 2 is not equal"
ElseIf check3 <> trucheck Then
MsgBox "check 3 is not equal"
End If
End Sub
Also, cell truechek is just 1=1 to get a value of TRUE....how do I just use TRUE in vba?
Thanks -Loren
here is my current code"
Sub check()
If check0 = truecheck Then
MsgBox "control totals tie out"
ElseIf check1 <> trucheck Then
MsgBox "check 1 is not equal"
ElseIf check2 <> trucheck Then
MsgBox "check 2 is not equal"
ElseIf check3 <> trucheck Then
MsgBox "check 3 is not equal"
End If
End Sub
Also, cell truechek is just 1=1 to get a value of TRUE....how do I just use TRUE in vba?
Thanks -Loren