hi
dear all
good morning
I am using the following code to prevent the copy/cut and paste command by the user which is working smoothly.
I want to use this code with a macro....guide me how I can add a macro to enable this coding and another macro to disable this coding
dear all
good morning
I am using the following code to prevent the copy/cut and paste command by the user which is working smoothly.
I want to use this code with a macro....guide me how I can add a macro to enable this coding and another macro to disable this coding
Code:
Private Sub Workbook_Activate()
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
MsgBox "You Are Not Allowed To Paste Anything"" " & vbNewLine & "For Futher Help Contact Admin", , "PES RESCUE 1122 MULTAN"
End Sub
Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.CutCopyMode = False
End Sub
Last edited by a moderator: