|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 7016427 于 2020-1-15 13:10 编辑
Private Sub Worksheet_Change(ByVal Target As Range)
' 以下代码,当Cells(40, 7).Value - Cells(40, 10).Value = 0时,要提示:X窗口的,收入与支出合计金额不平!多缴:0.00,请问老师怎样改才不提示?
If Cells(6, 10).Value > 0 And Cells(40, 7).Value - Cells(40, 10).Value > 0 Then
MsgBox Cells(3, 1) & "窗口的,收入与支出合计金额不平!" & Chr(10) & Chr(10) & "少缴:" & Format(Cells(40, 7).Value - Cells(40, 10).Value, "0.00"), 64, " 注 意"
End If
If Cells(6, 10).Value > 0 And Cells(40, 7).Value - Cells(40, 10).Value < 0 Then
MsgBox Cells(3, 1) & "窗口的,收入与支出合计金额不平!" & Chr(10) & Chr(10) & "多缴:" & Format(Cells(40, 7).Value - Cells(40, 10).Value, "0.00;0.00"), 64, " 注 意"
End If
End Sub
补充说明:只能发生Cells(40, 7).Value - Cells(40, 10).Value大于0,或者Cells(40, 7).Value - Cells(40, 10).Value时小于0,提示。
|
|