De: tom Ogilvy Objet: Re: Disable Cut/Paste Date : jeudi 14 octobre 1999 02:53 Jerry, Here is a start: Private Sub Worksheet_selectionChange(ByVal Target As Excel.range) if application.CutCopyMode = xlCut then application.enableevents = false application.CutCopyMode = false application.enableevents = true end if end Sub You can use a static variable to record the previous selection - not shown (this should be the cells cut I would think). When the user selects the destination for the paste of the cut cells, the selectionChange will fire again. You can just turn off cut copy mode. HTH, tom Ogilvy MVP Excel Jerry W. Lewis wrote in message news:38052E49.286336FE@erols.com... > I need to disable Cut/Paste without disabling Copy/Paste on certain > analysis template sheets because of Cut/Paste's potential to change > validated cell formulas. I cannot lock every cell, because the point is > for the user to enter data in certain cells. The rest of the cells are > already locked, but the formulas in those locked cells can still be > changed by cut/paste in the unlocked cells. > > - Is there any way to intercept the paste event on selected sheets and > cancel it if the cells were cut instead of copied? > > - The following on the worksheet code page looked promising but has > problems > Private Sub Worksheet_Activate() > application.CommandBars("Worksheet Menu > Bar").Controls("Edit").Controls("Cut").Enabled = false > application.CommandBars("Standard").Controls("Cut").Enabled = > false > end Sub > Private Sub Worksheet_Deactivate() > application.CommandBars("Worksheet Menu > Bar").Controls("Edit").Controls("Cut").Enabled = true > application.CommandBars("Standard").Controls("Cut").Enabled = > true > end Sub > The problem is that Worksheet_Activate and Worksheet_Deactivate do not > trigger when changing from one workbook to another. I could mirror the > code in Workbook_Deactivate and Workbook_Activate with a check to see if > the particular sheet is involved, but I prefer to keep the sheet > self-contained since it will be copied into other workbooks. > - Is there a sheet-level event that triggers when focus changes > to/from a sheet from other workbooks as well as other sheets in the same > workbook? (I can't find such an event in the on-line help, but it would > not be the first time that source proved to be incomplete.) > - Can VBA read/modify code on the workbook code page? This could > allow the Worksheet_Activate event to determine if the sheet had been > copied to a new workbook, and if so update the Workbook_Activate and > Workbook_Deactivate code to handle the new sheet properly. > > - Is there a way to add an .OnAction routine to > application.CommandBars("Worksheet Menu Bar").Controls("Edit") to > determine whether cut should be enabled or disabled when the Edit menu > is selected? if so, can I do something similar for the Standard > toolbar? > > - Are there any other ideas for how to proceed? > > Jerry W. Lewis > StatsMan@erols.com > WARNING: I actively boycott all products and services marketed by spam!