PAfE VBA Refresh in Manual Calc Mode
Posted: Wed Mar 15, 2023 4:39 pm
Sharing findings I discovered today. We've been wracking our brains trying to find a way to get PAfE to refresh DBRWs etc. while staying in manual calc mode. The .Dirty() method of the Range class seems to be the magic function.
Anyone have a better way to do this?
Anyone have a better way to do this?
Code: Select all
Sub RecalcSelection()
Application.EnableEvents = False
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
Selection.Dirty
Application.Calculation = xlManual
End Sub
Sub RecalcSheet()
Dim ws As Worksheet
Set ws = ActiveSheet
Application.EnableEvents = False
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
ws.Cells.Dirty
Application.Calculation = xlManual
End Sub