Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unable cut in workbook
Please, can somebody help me write a macro to unable the cut function on a workbook
No matter how they try to cut, keyboard shorcut, edit menu, right-clicking on the cell(s), I would like to have this fuction unabled Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unable cut in workbook
Note that I disable the DragAndDrop feature which is
another form of cut and paste. However, this can be reset by selecting this option through Tools|Options|Edit tab|Allow cell drag and drop checkbox. Therefore, I automatically disable it every time there is a selection change. Correct for wordwrap corruption and doubling of leading periods if it occurs. Paste to the ThisWorkbook module:- Dim DragAndDropStatus As Boolean Private Sub Workbook_Open() With Application DragAndDropStatus = .CellDragAndDrop ..OnKey "^{x}", "" ..CellDragAndDrop = False ..CommandBars("Cell").Controls("Cut").Enabled = False ..CommandBars("Worksheet Menu Bar").Controls ("Edit").Controls("Cut").Enabled = False End With End Sub Private Sub Workbook_Deactivate() With Application ..CellDragAndDrop = DragAndDropStatus ..CommandBars("Cell").Controls("Cut").Enabled = True ..CommandBars("Worksheet Menu Bar").Controls ("Edit").Controls("Cut").Enabled = True End With End Sub Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) Application.CellDragAndDrop = False End Sub Not rigorously tested. Never used by me so I can't attest to the practicality. Regards, Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to Unlock Workbook | Excel Worksheet Functions | |||
unable to open workbook | Excel Discussion (Misc queries) | |||
unable to open workbook | Excel Worksheet Functions | |||
Unable to Share my workbook | Excel Worksheet Functions | |||
Unable to Share Workbook | Excel Discussion (Misc queries) |