Hi everyone,
Having difficulty trying to prevent user error in an excel workbook i have created.
Trying to disable Cut/Copy/Paste/Drag&Drop in all worksheets except one specific worksheet
I need to allow copy from one specific sheet and allow it to paste into another workbook.
The problem i got is when go to paste to another workbook the copy data has gone
Having difficulty trying to prevent user error in an excel workbook i have created.
Trying to disable Cut/Copy/Paste/Drag&Drop in all worksheets except one specific worksheet
I need to allow copy from one specific sheet and allow it to paste into another workbook.
The problem i got is when go to paste to another workbook the copy data has gone
VBA Code:
Private Sub Workbook_Activate()
If ActiveSheet.Name = "Export" Then
Application.CutCopyMode = True
Application.OnKey "^c", ""
Application.CellDragAndDrop = True
Else
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End If
End Sub
Private Sub Workbook_Deactivate()
Application.OnKey "^c", ""
Application.CellDragAndDrop = True
Application.CutCopyMode = True
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
On Error Resume Next
If Sh.Name = "Export" Then
Application.CutCopyMode = True
Application.CellDragAndDrop = True
Else
Application.OnKey "^c", ""
Application.CutCopyMode = False
Application.CellDragAndDrop = False
End If
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.CellDragAndDrop = True
Application.CutCopyMode = True
End Sub