Maybe something along the lines of:
Sub KittenExplosion()
Application.EnableEvents = False
application.Calculation =xlCalculationManual
'copying and pasting stuff
Application.EnableEvents = True
application.Calculation =xlCalculationAutomatic
End Sub
This will prevent the workbook from calculating formula outputs or running additional subs while the macro is running.
Edit: I found an additional solution on the interwebs.
Delcare a global variable at the top of your module, and set it to on while the macro runs. Worksheet_Change event can see if it's on, and stop if it is.
Public CopyRunning As String
Sub CopyPasteMacro()
CopyRunning = "On"
'copy and paste stuff
CopyRunning = "Off"
End Sub
and then worksheet_change macro:
Private Sub Worksheet_Change(ByVal Target As Range)
If CopyRunning = "On" Then Exit Sub
'normal code stuff
End Sub
Bookmarks