View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Substitute copy for cut

Whilst agreeing with Charles that your users should be able to handle a copy
or cut correctly, see if this untested code helps. Based on code from the
Help example for "CutCopyMode Property".

Const RangeNoCut As String = "A1:M500"
Dim PreviousRange As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not PreviousRange Is Nothing Then
If Not Intersect(PreviousRange, Range(RangeNoCut)) Is Nothing Then
Select Case Application.CutCopyMode
Case Is = False
'Normal, allow
'MsgBox "Not in Cut or Copy mode"
Case Is = xlCopy
'Copy, allow
'MsgBox "In Copy mode"
Case Is = xlCut
'Cut, change to copy
'MsgBox "In Cut mode"
'Cancel the Cut
Application.CutCopyMode = False
'Now copy the previous range
PreviousRange.Copy
End Select
End If
End If

Set PreviousRange = Target

End Sub


"KS" wrote in message
ups.com...
I have some users that cannot figure out difference between copy and
cut. They are always cutting when they should be copying. How can I
write a code that anytime, anyway they choose cut it will automatically
change it to a copy? They are basically selection some cells in a
worksheet & cutting them somewhere else in the worksheet. What they are
doing is simple but how can I override their keystrokes to be the
correct one?

Thanks for any help.

KS