Private Sub NewCycle_Click()
If ThrusterList.Value <> "Thr A Bank" And ThrusterList.Value <> "Thr B Bank" _
And ThrusterList.Value <> "Both" Then
Unload Me
Cells(20, 1).Value = "thr error"
Exit Sub
End If
If GammaList.Value <> "User Provided" Then
Unload Me
Cells(20, 1).Value = "gam error"
Exit Sub
End If
If ThrusterList.Value = "Thr A Bank" Or ThrusterList.Value = "Both" Then
If T1Aval.Value = "" Or T2Aval.Value = "" Or T3Aval.Value = "" Or T4Aval.Value = "" Then
Unload Me
Cells(20, 1).Value = "ta error"
Exit Sub
End If
End If
If ThrusterList.Value = "Thr B Bank" Or ThrusterList.Value = "Both" Then
If T1Bval.Value = "" Or T2Bval.Value = "" Or T3Bval.Value = "" Or T4Bval.Value = "" Then
Unload Me
Cells(20, 1).Value = "tb error"
Exit Sub
End If
End If
以下是尝试从用户窗体运行此命令按钮代码时发生的事件序列:
似乎没有押韵或理由为什么这样做,而且我现在正在打屁股。唯一的另一个选择是制作一个巨大的嵌套if-loop来包含所有内容,但这是最后的选择。