in an attempt to track (and optimise) worksheet calculation loops, in ThisWorkbook I wrote:
Code: Select all
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
If Sh Is Nothing Then
Call LogMsg("SheetCalculation with No Object")
Else
Call LogMsg("Recalculated " & Sh.Parent.Name & "::" & Sh.Name)
End If
End Sub ' Workbook_SheetCalculate
The event triggers on at least some worksheet calculations.
Problem: Sh is Nothing, so I can't tell which sheet is being calculated.
Caveat: putting logging into the calculation events of all sheets is inelegant and impractical.
Is there a solution? a Duh! moment on my part? wishing for the moon?
TIA for any insight.
ZK