坦率地说,我不知道这何时停止工作,但不久就切换到使用 Office 2016。无论哪种方式,现在以前触发的 VBA 事件现在都没有这样做。至少它不会停在我可以设置断点的子中的第一个位置。
在此项目或其他打开的项目中没有使用 EnableEvents,并且在先前触发事件的地方,重新格式化活动单元格的过程和另一个,现在它什么也不做。
非常感谢任何帮助!
Public Sub Worksheet_Change(ByVal Target As Range)
Const STATUSCOL1 = "L"
Const STATUSCOL2 = "M"
Const STATUSCOL3 = "N"
Const STATUSCOL4 = "O"
Const STATUSCOL5 = "P"
Const STATUSCOL6 = "Q"
Const STATUSCOL7 = "R"
Const STATUSCOL8 = "S"
Const ACTIONCOL1 = "NOT IMPLEMENTED"
Dim Cell As Range
Dim ac As String
Dim rgtCellVal As Integer
Set Cell = Target
ac = Split(Cell.Address, "$")(1) 'For Column Letter
'if any changes at all mark colum J in Green
If Target.Cells.Count = 1 Then
'If Cell <> IIf(vOldData = vbNullString, "(Null)", vOldData) Then
If Cell.Value <> vOldData Then
Select Case ac
Case ACTIONCOL1
Cells(Cell.Row, Range("J" & 1).Column).Interior.ColorIndex = 42 'Aqua
Case Else
Cells(Cell.Row, Range("J" & 1).Column).Interior.ColorIndex = 4 'bright green
End Select
End If
End If
'Status
'---------------------------------------------------------------------------------------------------------
'Installed & Active
'I&A with Bugs
'Compromise
'If Required
'NotActivatedOrUsed
'UserBlogUseOnly
'UpdateHold
'------------------------------------------
'Deactivated
'Depricated
'Removed
'Not Installed
'------------------------------------------
'Failed
'Broken but activated
'Broken and deactivated
'------------------------------------------
'Status in question
'Ignore
'N.A.
'Not Actionable
'In Progress
'Review
'ConsiderNew
If ac = STATUSCOL1 Or ac = STATUSCOL2 Or ac = STATUSCOL3 Or ac = STATUSCOL4 Or ac = STATUSCOL5 Or ac = STATUSCOL6 Or ac = STATUSCOL7 Or ac = STATUSCOL8 Then
Select Case Cell
Case ""
Cell.Interior.ColorIndex = xlColorIndexNone 'none
Case "Installed & Active"
Cell.Interior.ColorIndex = 43 'Lime
Case "I&A with Bugs"
Cell.Interior.ColorIndex = 36 'Light Yellow
Case "Compromise"
Cell.Interior.ColorIndex = 35 'Light Green
Case "If Required"
Cell.Interior.ColorIndex = 15 'Grey - 25%
Case "UserBlogUseOnly"
Cell.Interior.ColorIndex = 15 'Grey - 25%
Case "UpdateHold"
Cell.Interior.ColorIndex = 46 'Orange
'------------------------------------------
Case "NotActivatedOrUsed"
Cell.Interior.ColorIndex = 15 'Grey - 25%
Case "Deactivated"
Cell.Interior.ColorIndex = 15 'Grey - 25%
Case "Depricated"
Cell.Interior.ColorIndex = 37 'pale blue
Case "Removed"
Cell.Interior.ColorIndex = 41 'Light blue
Case "Rejected"
Cell.Interior.ColorIndex = 41 'Light blue
Case "Not Installed"
Cell.Interior.ColorIndex = 37 'pale blue
'------------------------------------------
Case "Failed"
Cell.Interior.ColorIndex = 3 'Red
Case "Broken"
Cell.Interior.ColorIndex = 3 'Red
Case "BrokenButDeactivated"
Cell.Interior.ColorIndex = 37 'pale blue
'------------------------------------------
Case "StatusInQuestion"
Cell.Interior.ColorIndex = 44 'Gold
Case "Ignore"
Cell.Interior.ColorIndex = xlColorIndexNone 'none
Case "N.A."
Cell.Interior.ColorIndex = xlColorIndexNone 'none
Case "Not Actionable"
Cell.Interior.ColorIndex = xlColorIndexNone 'none
Case "In Progress"
Cell.Interior.ColorIndex = 15 'Grey - 25%
Case "Review"
Cell.Interior.ColorIndex = 33 'Sky Blue
Case "ConsiderAlt"
Cell.Interior.ColorIndex = 44 'Gold
Case "------------------------------------------"
Cell.Interior.ColorIndex = xlColorIndexNone 'none
Case Else
Cell.Interior.ColorIndex = 40 'Tan
rgtCellVal = Cell.Offset(0, 1).Interior.ColorIndex
If (Cell = "") And rgtCellVal = 15 Then
Cell.Interior.ColorIndex = 15
End If
End Select
End If
End Sub