Forum Discussion
Greg Bonaparte
Nov 06, 2018Iron Contributor
macro trouble: wait, msgbox and manual calc
Hello. I cant figure out why this macro fails. When I make a change to cells u30:u400 I want a 60 second pause, pop up a message, then I want the excel sheet to revert to manual mode calculation. Wh...
AIL AND
Nov 06, 2018Copper Contributor
Hello Greg Bonaparte,
May be you can try this :
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("U30:U400")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' Display a message when one of the designated cells has been
' changed.
' Place your code here.
MsgBox "Cell " & Target.Address & " has changed."
Application.Wait (Now + TimeValue("00:01:00"))
Application.Calculation = xlCalculationManual
End If
End sub