|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Private Sub Worksheet_Change(ByVal Target As Range)
If Cells(6, 10).Value > 0 Then
If 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, " 注 意"
ElseIf 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, " 注 意"
Else
Exit Sub
End If
End If
' 以下黄色执行不成功?请问老师怎么修改?
If Target.Column <> 3 Then Exit Sub
Dim rng As Range
For Each rng In Target
rng.Value = UCase(rng.Value)
Next
If Target.Column = 3 Then Target.Offset(0, 1).Select
If Target.Column = 4 Then Target.Offset(0, 1).Select
If Target.Column = 5 Then Target.Offset(0, 2).Select
End Sub
|
|