Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Disabling "cut" function - version 2003/2007
Does any one know how to disable "cut" function in a protected worksheet? By
allowing cutting in unprotected cell, it is messing up the formula that I put in the protected cell which is related to that unprotected cell. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Disabling "cut" function - version 2003/2007
Hi there wlam,
Paste this code in the "ThisWorkbook" VBA code module of the workbook you want to protect. Code is below. ----------------------- Const DisableCutOperations As Boolean = True Private Sub Workbook_WindowActivate(ByVal Wn As Excel.Window) If DisableCutOperations = False Then Exit Sub Set CutButton = Application.CommandBars("Worksheet Menu Bar"). _ Controls("edit").CommandBar.Controls("Cut") CutButton.OnAction = "ThisWorkbook.DisableCut" End Sub Private Sub Workbook_WindowDeactivate(ByVal Wn As Excel.Window) Set CutButton = Application.CommandBars("Worksheet Menu Bar"). _ Controls("edit").CommandBar.Controls("Cut") CutButton.OnAction = Cut End Sub Sub DisableCut() If DisableCutOperations = False Then Exit Sub If ActiveWorkbook.Name = ThisWorkbook.Name Then dummy = MsgBox("Do NOT use the cut function in this Workbook please. ", _ vbInformation, ActiveWorkbook.Name) Exit Sub Else: Selection.Cut End If End Sub ----------------------- I hope this code works for you -- Thank you and Regards Garreth Lombard "wlam" wrote: Does any one know how to disable "cut" function in a protected worksheet? By allowing cutting in unprotected cell, it is messing up the formula that I put in the protected cell which is related to that unprotected cell. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disabling the "&[Time]" or "&[T]" in Excel headers and footers | Excel Discussion (Misc queries) | |||
Excel 2003: Conditional Formatting using "MIN" & "MAX" function | Excel Discussion (Misc queries) | |||
Need function that will work in Excel 2003 like "Countifs" in 2007 | Excel Worksheet Functions | |||
I cannot get my Excel sheets to "Group". (Student version 2003) | New Users to Excel | |||
Disabling "SAVE AS" option under "File" | Excel Discussion (Misc queries) |