I made two codes for one sheet to not allow copy paste and right click for column A only.
It work just fine for column A - but when I tried to copy on column B - the marching ants did show up but immediately disappear when I shift cell to copy. and it won't paste..
what is wrong with the codes?
many thanks..
It work just fine for column A - but when I tried to copy on column B - the marching ants did show up but immediately disappear when I shift cell to copy. and it won't paste..
what is wrong with the codes?
many thanks..
Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = False
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Cancel = True
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
Else
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = True
End If
End Sub