Hi,
If you want users not to change formulas, try to use the Format/Sheet/Protect or Format/Cell/Protect functions...
cheers
Samantha,
The following code disables the cut, copy & paste functions, I think you can modify it for other functions. The second block of code reenables them:
Private Sub Workbook_Activate()
' Turn off the menu
Application.CommandBars("Edit").Controls(3).Enabled = False
Application.CommandBars("Edit").Controls(4).Enabled = False
Application.CommandBars("Edit").Controls(5).Enabled = False
Application.CommandBars("Edit").Controls(6).Enabled = False
' Turn off the toolbar:
Application.CommandBars("Standard").Controls(7).Enabled = False
Application.CommandBars("Standard").Controls(8).Enabled = False
Application.CommandBars("Standard").Controls(9).Enabled = False
Application.CommandBars("Standard").Controls(10).Enabled = False
' turn off shortcutkeys:
Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "^x", ""
End Sub
Private Sub Workbook_Deactivate()
' Enable the menu:
Application.CommandBars("Edit").Controls(3).Enabled = True
Application.CommandBars("Edit").Controls(4).Enabled = True
Application.CommandBars("Edit").Controls(5).Enabled = True
Application.CommandBars("Edit").Controls(6).Enabled = True
' Enable the commandbar:
Application.CommandBars("Standard").Controls(7).Enabled = True
Application.CommandBars("Standard").Controls(8).Enabled = True
Application.CommandBars("Standard").Controls(9).Enabled = True
Application.CommandBars("Standard").Controls(10).Enabled = True
' Enable the shortcut keys:
Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "^x"
End Sub
To disable the user from "right-clicking" on the userform,
and still be able to cut, copy or paste, you can disable
the right-mousebutton by adding the following code to the VBA-sheet:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Excel.Range, Cancel As Boolean)
Cancel = True
End Sub
Is this what you were after?
Regards,
Ian