Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default 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
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
Disabling the "&[Time]" or "&[T]" in Excel headers and footers John Mirabella Excel Discussion (Misc queries) 2 January 15th 10 02:54 PM
Excel 2003: Conditional Formatting using "MIN" & "MAX" function MMangen Excel Discussion (Misc queries) 2 September 16th 08 07:13 PM
Need function that will work in Excel 2003 like "Countifs" in 2007 RD[_2_] Excel Worksheet Functions 3 August 1st 08 04:35 PM
I cannot get my Excel sheets to "Group". (Student version 2003) OLD Jim New Users to Excel 1 June 29th 06 11:35 AM
Disabling "SAVE AS" option under "File" Bidyut Bhattacharjee Excel Discussion (Misc queries) 3 March 22nd 06 06:35 PM


All times are GMT +1. The time now is 02:34 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"