|
楼主 |
发表于 2011-8-12 12:17
|
显示全部楼层
回复 无聊的疯子 的帖子
Private Sub Worksheet_Change(ByVal Target As Range)
For r = 3 To 112
If Target.Column = 8 And Cells(r, 8) = "" Then
Exit Sub
Else
End If
Next
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim r As Integer
For r = 3 To 112
If Target.Column = 8 And Cells(r, 8) <> 0 Then
Cells(r, 30).Value = Val(Cells(r, 22)) - Val(Cells(r, 24)) _
- Val(Cells(r, 25)) - Val(Cells(r, 26)) _
- Val(Cells(r, 27)) - Val(Cells(r, 28)) _
- Val(Cells(r, 29))
Cells(r, 22).Value = Cells(r, 14) + Cells(r, 15) _
+ Cells(r, 17) - Val(Cells(r, 16)) _
+ Val(Cells(r, 19)) + Val(Cells(r, 20)) _
+ Val(Cells(r, 21)) + Val(Cells(r, 18))
Cells(r, 23).Value = Val(Cells(r, 22)) _
- Val(Cells(r, 17)) _
- Val(Cells(r, 26)) - 2000
End If
Next
End Sub
这位大哥,你看我写的这个change事件,为什么运行不了,麻烦帮我看下问题出在哪里好吗?
|
|