通过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
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
一周热门 更多>