我运行代码VBA
测试是否细胞右边是小于0,如果是,则使活动单元格0。这应该运行在小区被输入。这是我到目前为止有:VBA计算单元格值之前如果/然后声明
Private Sub worksheet_change(ByVal target As Range)
If Not Intersect(target, Range("c7:c27")) Is Nothing Then isNegative
End Sub
然后
Sub isNegative()
Dim cell As Range
If ActiveCell.Offset(1, 0).Value < 0 Then
ActiveCell.Value = 0
End If
End Sub
但是,我认为正在发生的事情是,它在计算前检查数据。我该如何解决?
'Application.Calculate'? – Gaffi 2013-04-24 14:05:16