Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default 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
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
Unable to Unlock Workbook Adrian Excel Worksheet Functions 1 March 26th 10 04:16 PM
unable to open workbook kags Excel Discussion (Misc queries) 4 June 9th 09 01:07 PM
unable to open workbook Terry Excel Worksheet Functions 0 September 2nd 08 03:05 PM
Unable to Share my workbook SDCowley Excel Worksheet Functions 0 March 6th 08 05:33 PM
Unable to Share Workbook Burnt Excel Discussion (Misc queries) 2 June 30th 06 11:07 AM


All times are GMT +1. The time now is 02:58 AM.

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

About Us

"It's about Microsoft Excel"