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

144
提问者
2023-03-16 08:08 悬赏 0财富值 阅读 1019回答 1

通过VBA实现Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Rang

默认分类
登录 后发表回答
1楼 · 2023-03-16 08:42.采纳回答

通过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