excel 使D列自动显示B列减C列所填的数值 怎样做?

excel

1个回答

写回答

魏贝贝

2025-10-03 22:15

+ 关注

VBA
VBA

D1输入=B1-C1向下拉四行即可,注意只用四行。也就是拉到D5就行了。以后BC列,输入内容,D列自动添加公式这也觉得麻烦的话,你只能用VBA了。感觉不值当的。

工作表事件Private Sub Worksheet_Change(ByVal Target As Range) i = Target.Row If Application.Intersect(Target, [B:C]) Is Nothing Then Exit Sub Cells(i, 4) = Cells(i, 2) -Cells(i, 3)End Sub

举报有用(4分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号