EXCEL中vba怎么应用整列

excelVBA

1个回答

写回答

ztsa

2025-12-20 20:35

+ 关注

Private Sub Worksheet_Change(ByVal Target As Range)If Not Intersect(Target, Range("1:100")) Is Nothing ThenExit SubEnd IfFor Each c In TargetIf c.Column = 2 And c.Row > 1 ThenCells(c.Row, 2) = Cells(c.Row - 1, 2) + Cells(c.Row, 2)ElseCells(c.Row, 2) = Cells(c.Row, 1) + Cells(c.Row, 2)End IfNextEnd Sub

举报有用(0分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号