|
本帖最后由 7016427 于 2018-8-11 20:16 编辑
Private Sub CommandButton1_Click()
' 请老师,帮我看看,以下黄色4句无法正确判断,也没有错误提示的问题
Dim wt As Workbook, d As String, s As String
d = "少退票费收据:"
s = "多退票费收据:"
With ThisWorkbook.Sheets("财收22")
.Unprotect Sheet6.[aa1]
.Range("w81").Value = TextBox5.Value
.Range("w82").Value = TextBox6.Value
.Range("w83").Value = TextBox7.Value
.Range("w84").Value = TextBox8.Value
.[x81].Formula = "=IF(w81>0,(w81-t81+1)*0.5,"""")"
.[x82].Formula = "=IF(w82>0,(w82-t82+1)*1,"""")"
.[x83].Formula = "=IF(w83>0,(w83-t83+1)*5,"""")"
.[x84].Formula = "=IF(w84>0,(w84-t84+1)*10,"""")"
.[x85].Formula = "=sum(r[-1]c:r[-4]c)"
If Val(TextBox5.Value) < .[w81].Value Then MsgBox "退票费伍角的止号,不能小于上次该票据使用 " & Chr(10) & Chr(10) & "的止号,按确定时自动调到上次止号!", 64, " 提 示": TextBox5.Value = .[w81].Value: Exit Sub
If Val(TextBox6.Value) < .[w82].Value Then MsgBox "退票费壹元的止号,不能小于上次该票据使用 " & Chr(10) & Chr(10) & "的止号,按确定时自动调到上次止号!", 64, " 提 示": TextBox6.Value = .[w82].Value: Exit Sub
If Val(TextBox7.Value) < .[w83].Value Then MsgBox "退票费伍元的止号,不能小于上次该票据使用 " & Chr(10) & Chr(10) & "的止号,按确定时自动调到上次止号!", 64, " 提 示": TextBox7.Value = .[w83].Value: Exit Sub
If Val(TextBox8.Value) < .[w84].Value Then MsgBox "退票费拾元的止号,不能小于上次该票据使用 " & Chr(10) & Chr(10) & "的止号,按确定时自动调到上次止号!", 64, " 提 示": TextBox8.Value = .[w84].Value: Exit Sub
If (.[ad26].Value + .[ag23].Value) - .[x85].Value > 0 Then MsgBox d & Format((.[ad26].Value + .[ag23].Value) - .[x85].Value, "0.00;0.00 "), 16, " 警 告!": Exit Sub
If (.[ad26].Value + .[ag23].Value) - .[x85].Value < 0 Then MsgBox s & Format((.[ad26].Value + .[ag23].Value) - .[x85].Value, "0.00;0.00 "), 16, " 警 告!": Exit Sub
End With
Unload Me
End Sub
|
|