I have written a script in the workbook that sends a msgbox warning users not to copy and paste cells whenever they do so.
Target.PasteSpecial xlPasteValues
If Application.CutCopyMode = xlCopy Then
MsgBox ("Please do not copy and paste cells. This can cause errors in log sheet")
ElseIf Application.CutCopyMode = xlCut Then
MsgBox ("Please do not copy and paste cells. This can cause errors in log sheet")
End If
Application.CutCopyMode = False
The problem is I have made other scripts assigned to buttons which are used to copy and paste specific cells when the function is called, but I get my own warning message pop up when this happens. Is there a way to prevent the msgbox popping up in these instances?
I have tried;
Application.DisplayAlerts = False
Application.DisplayAlerts = True
But this doesn't seem to work with scripted msgboxes