Office中国论坛/Access中国论坛

标题: A1中有数值10,再次键入5后如何使A1等于15? [打印本页]

作者: IkeyZheng    时间: 2007-11-16 16:37
标题: A1中有数值10,再次键入5后如何使A1等于15?
A1中有数值10,再次键入5后如何使A1等于15?
相等于累加的效果
作者: pureshadow    时间: 2007-11-17 00:25
除了加辅助列,我想不到更好的办法。
作者: liwen    时间: 2007-11-17 11:46
不是不可能,但这样做有什么意义呢?

Dim aAddress
Dim aStr
Dim ai As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
If aAddress = Target.Address And ai Then
ai = False
Target.FormulaR1C1 = Target.Value + aStr
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
aAddress = Target.Address
aStr = Target.Value
ai = True
End Sub




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3