Warning: fopen(/www/wwwroot/www.wendadaohang.com/data/md5_content_title/6d/6d54623302d6c8a48a706312755d0693.txt): failed to open stream: No space left on device in /www/wwwroot/www.wendadaohang.com/inc/function.php on line 2468

Warning: flock() expects parameter 1 to be resource, bool given in /www/wwwroot/www.wendadaohang.com/inc/function.php on line 2469

Warning: fclose() expects parameter 1 to be resource, bool given in /www/wwwroot/www.wendadaohang.com/inc/function.php on line 2475
excel中如何使录入的数据自动累加在上一次的结果上面? - 55问答网

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
相似回答