Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I used code from Jim Rech below to disable cut and past as well as drag and
drop so my formula's don't get messed up when some one does a cut/past to a data cell. However, the .CellDragAndDrop=false command not only stops drag and drop but also stops drag and fill (drag and copy). I want to keep that functionality. Is there a way to stop drag and drop without stopping drag and fill/copy? Here is the code i'm using to do all of this: Sub CutsOff() AllowCuts False End Sub Sub CutsOn() AllowCuts True End Sub Sub AllowCuts(bEnable As Boolean) Dim oCtls As CommandBarControls, oCtl As CommandBarControl Set oCtls = CommandBars.FindControls(ID:=21) ''Cut If Not oCtls Is Nothing Then For Each oCtl In oCtls oCtl.Enabled = bEnable Next End If ''Disable Tools, Options so D&D cannot be restored Set oCtls = CommandBars.FindControls(ID:=522) If Not oCtls Is Nothing Then For Each oCtl In oCtls oCtl.Enabled = bEnable Next End If With Application .CellDragAndDrop = bEnable If bEnable Then .OnKey "^x" .OnKey "+{Del}" Else .OnKey "^x", "" .OnKey "+{Del}", "" End If End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Shortcut to switch from "fill down" to "copy" with mouse drag | Excel Discussion (Misc queries) | |||
Disable "Cut&Paste" and "Drag&Drop" | Excel Programming | |||
how can I disable "cutting cells" and "drag and drop "in excel ? | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
disable cell "drag and drop" for a cell/range meeting given condit | Excel Programming |