LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
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



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE.... max. limit 8 :( [email protected] Excel Discussion (Misc queries) 6 May 22nd 08 05:33 PM
Substitute mrbalaje Excel Discussion (Misc queries) 2 March 15th 07 07:47 AM
More than 7 IF? any substitute? Jean Excel Worksheet Functions 4 March 9th 07 05:41 AM
substitute AMK Excel Worksheet Functions 1 June 13th 05 01:23 AM
using a substitute value Tracy D. Excel Programming 1 March 1st 05 07:41 PM


All times are GMT +1. The time now is 10:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"