excel中没有没办法设定一列中当所有数的和值到10后自动到下一列的办法.

2023-07-26 14:26发布

通过VBA实现Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Rang
1条回答
1楼 · 2023-07-26 15:06.采纳回答
通过VBA实现
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

If Target.Rows.Count > 1 Or Target.Columns.Count > 1 Then
Exit Sub
End If
c = Target.Column
n = Application.WorksheetFunction.Sum(Columns(c))
If n = 8 Then ‘如果是要值>=8就跳转,那就改成n>=8
Cells(1, c + 1).Select
End If
End Sub

一周热门 更多>