excel中如何使录入的数据自动累加在上一次的结果上面?

如题所述

步骤如下:

1、按ALT+F11

2、按F7,粘贴如下代码,并调整为如下格式

3、按F5运行。

4、代码:

Private Sub Worksheet_Change(ByVal Target As Range)
a = Cells(2, 1).Value
If Target = Cells(1, 1) Then
Cells(2, 1) = a + Target.Value
End If
End Sub

温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-01-26
ALT+F11——F7——粘贴如下代码,并调整为如下格式——F5运行。
Private Sub Worksheet_Change(ByVal Target As Range)
a = Cells(2, 1).Value
If Target = Cells(1, 1) Then
Cells(2, 1) = a + Target.Value
End If
End Sub
相似回答