Combobox在用户按下消息框的yes按钮后显示

时间:2017-10-02 16:01:52

标签: excel-vba vba excel

If MSG1 = vbNo And MSG2 = vbYes And MSG3 = vbNo Then
MSG4 = MsgBox("Is the invoice Corporate?", vbYesNo, "Account Validation")

If MSG4 = vbYes Then
Related_to.Show

If Me.Related_to.Value = Royalties Then
MsgBox ("Whatever")
End If

2 个答案:

答案 0 :(得分:0)

使用更新后的代码,您需要进行以下调整。如果这不是您要查找的内容,请更新您的问题以包含实际问题。

Sub Test()

    If MSG1 = vbNo And MSG2 = vbYes And MSG3 = vbNo Then
        MSG4 = MsgBox("Is the invoice Corporate?", vbYesNo, "Account Validation")

    ElseIf MSG4 = vbYes Then
        Related_to.Show

    ElseIf Me.Related_to.Value = Royalties Then
        MsgBox ("Whatever")
    End If

End Sub

答案 1 :(得分:0)

Sub account_validation_Issued()

MSG1 = MsgBox("Is the invoice X Related?", vbYesNo, "Account Validation")
MSG2 = MsgBox("Is the invoice ECD?", vbYesNo, "Account Validation")
MSG3 = MsgBox("Is the invoice Project related?", vbYesNo, "Account Validation")

If MSG1 = vbNo And MSG2 = vbYes And MSG3 = vbYes Then
MsgBox ("Unvalid answer combiantion")

ElseIf MSG1 = vbYes And MSG2 = vbYes And MSG3 = vbYes Or MSG1 = vbYes And MSG2 = vbNo And MSG3 = vbYes Then
MsgBox ("Projects: XXXX")

ElseIf MSG1 = vbYes And MSG2 = vbYes And MSG3 = vbNo Or MSG1 = vbYes And MSG2 = vbNo And MSG3 = vbNo Then
MsgBox ("Projects: XXXX")

ElseIf MSG1 = vbNo And MSG2 = vbNo And MSG3 = vbNo Then
MsgBox ("Projects: XXXX")

ElseIf MSG1 = vbNo And MSG2 = vbNo And MSG3 = vbYes Then
MsgBox ("Unvalid answer combiantion")

ElseIf MSG1 = vbNo And MSG2 = vbYes And MSG3 = vbNo Then
MSG4 = MsgBox("Is the invoice Corporate?", vbYesNo, "Account Validation")

Related_to.Show

End If

End Sub

私人小组UserForm_Error(BYVAL编号为整数,BYVAL说明作为MSForms.ReturnString,BYVAL SCODE长,BYVAL源作为字符串,BYVAL HELPFILE作为字符串,BYVAL HelpContext长,BYVAL CancelDisplay作为MSForms.ReturnBoolean)

选择Case Me.MyCombo 案例"特许权使用费" MsgBox"确保为Above Target表现"

输入评论
    MSG4 = MsgBox("Is the invoice Corporate?", vbYesNo, "Account Validation")

If MSG4 = vbYes And Me.Related_to.Value = Royalties Then

    MsgBox ("Whatever")
End If

End Sub