Hi guys,
I am trying to write a macro to copy/paste cells when a formula in AC5 = 60.
I have put this code in the worksheet:
And this code in a module:
But it is not firing when AC5 = 60.
Can anyone see what I'm doing wrong?
Thanks
I am trying to write a macro to copy/paste cells when a formula in AC5 = 60.
I have put this code in the worksheet:
VBA Code:
Private Sub Worksheet_Calculate()
If Range("AC5") = "60" Then Call Capture
End Sub
And this code in a module:
VBA Code:
Sub Capture()
Application.ScreenUpdating = False
With ThisWorkbook.Worksheets("Market").Range("Y5:Y34").Copy
ThisWorkbook.Worksheets("Market").Range("Z5").PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
But it is not firing when AC5 = 60.
Can anyone see what I'm doing wrong?
Thanks