Re-enable Right Click Options, Disable Cut Functions
Sep 30, 2008
I need a macro to disable all cut options (ctrl^x, right click cut, cut button in ribbon above), disable drag and drop, but still allow copying and pasting (the cutting affects cell references). I've already locked the spreadsheet, but users need to be able to input information and paste information in from other workbooks. This code must also only apply to THIS WORKBOOK and not affect others. Please help with a macro for this, as well as where to paste and how to properly configure macro security settings. I'm a big excel user, but this is my first time ever with VB and macros so talk to me like I'm dumb! I've pasted links to the two codes I tried, and I think one of them enabled a macro that affected all workbooks and now whatever code I put in won't save upon re-opening. It's there when I navigate to it, but it is ineffective like it's not even there. In macro security, I've enabled all macros and have the "trust VB programming" box checked. So maybe do some damage control before re-programming. I am getting a new computer in less than a month, but I want to be able to try out the code and have it work first, and I don't want to transfer the harmful code to the new computer.
P.S. This first code allows copying and cutting, but then just disables pasting, which is not what I want. The second one works great, but disables the right click menu altogether, which is no good either. And neither allow for pasting from the outside. And this is for moderate excel users, they won't try to erase the macro. I just need to keep them from making mistakes with cutting.
way, using VBA code, to disable/enable individual shortcut menu items that are are made available with a right mouse button click. The following code disables the right mouse button completely but I would like to disable only a couple of options like the ' Cut' option.
The code to disable is below and to re-enable I just change False to True.
Dim cb As CommandBar i = 0 For Each cb In CommandBars If cb.Type = msoBarTypePopup Then cb.Enabled = False Next cb
Below are the codes to hide the objects within Excel, Disable Keyboard shortcuts and disable right click, all are placed in the ThisWorkbook and i placed them in a 'Private Sub Workbook_Open()' function.
VB: 'Change 'False' to 'True' to unhide ActiveWindow.DisplayGridlines = False ActiveWindow.DisplayHeadings = False
There maybe simpler ways to do the above i just don't know them, it's just these have worked for me and i have had zero bugs come back from them!
Is it possible to enable/disable a texbox in excel which has been assigned a macro. To make it clear I'm not talking about a textbox within a userform. I understand I should really be using command buttons but I prefer the look of textboxes.
I have the following code to change the colour of the textbox (name: txtCreateInvoice) but the final line to disable the textbox doesn't work.
Sheets(1).Shapes.Range(Array("txtCreateInvoice")).Select With Selection.ShapeRange.Fill.ForeColour .ObjectThemeColor = msoThemeColorText1 .Brightness = 0.5 End With Selection.Enabled = False
On several of my worksheets, I'm asked if I want to disable/enable the macros but there are none associated with that particular worksheet- matter of fact, none of my worksheets have macros unless pivot tables count, so why am I being prompted in that way?
I have 3 checkboxes on a worksheet. I have a command button to copy/paste data that is captured from a device.
I want the data to go to the ranges that are selected by referring to the true/false driving mechanism of the check boxes.
Obviously if more than one button is checked at one time, the whole shooting match will blow up.
So....how can I allow only one check box to be active at any given time? I'm thinking perhaps a select case statement that refers to the possible conditions of true true true, true true false, true false true, etc....If that would work, how could the code be simplified?
Let's call them cb1, cb2 & cb3. Is this even possible??
I have a checkbox (checkbox1) on a userform that functions to disable two listboxes (monthListbox & yearListbox) when checked. For this, I have the following
Private Sub CheckBox1_Click() MonthListBox.Enabled = Not CheckBox1 MonthListBox.BackColor = &H8000000B MonthListBox.Locked = True YearListBox.Enabled = Not CheckBox1 YearListBox.BackColor = &H8000000B YearListBox.Locked = True
This works fine and dandy. However, when testing the userform, when I "unchecked" the checkbox, it did not undo the actions. So my question is, is there a sub to undo the actions that the above code does after I "uncheck" the checkbox. Additionally...under what event would I write this sub since I've already completed the sub for Checkbox_Click()
I want to hide all toolbars and disable the red X upon opening of the spreadsheet, and to restore the main toolbars upon closing. That worked perfectly. (when I used the black code -see below) I added in the red code as i wanted to disable the red X as well to ensure that users will always close the EXCEL worksheet via a Macro button.
The Macro will save the spreadsheet and close the worksheet and the Private sub should restore the toolbars.
I am attempting to modify a spreadsheet so that it will enable a range on Sheet3 (I9:K42) if a check box is checked on Sheet2. If it is not checked, it will lock that range on Sheet 3 and grey (or gray, if you prefer) out that range.
I recently added a macro in excel that stopped users from cutting and pasting and dragging etc. I got the macro from the web. I have delete the macro, but for some reason I cannot get it back to normal. If I right click on a cell the cut, copy, insert, delete, format cell menu is grayed out. The undo button also does not work? I have searched for the macro and deleted it but it seems to have changed something else. I have even tried to disable macros, but all menu items are still gone?
I have collected some data from survey respondents, and I have the following array formula:
What I'd like to do is make the 3rd criterion -- $H$1:$H$400="american" -- dependent on whether the string value in cell A1 ("Evaluate Americans only?") is "yes" or "no".
Because, my actual situation is considerably more complex (see below), I'm looking to insert a test within the MIN array formula to check the value of A1, and calculate the answer accordingly.
I'm aware that I could theoretically create two array arguments (one with & one without the American test), and place them inside an IF function that tests the value of A1. However that isn't practical for my real-world situation...
I occasionally see array formulas with all sorts of symbols that I don't really understand in the array context (such as * and | and . ), and I'm wondering if one of those magic symbols might be the doorway to my solution.
I am creating a form that performs several different functions. I would like to force a sequence of these functions by enabling/disabling the controls based on a variable.
For example, a form as two buttons Button1 and Button2. By default, Button1 is ENABLED and Button2 is DISABLED. When Button1 is clicked, a macro is run, where an Enable_Button2variable is initialized to FALSE. The last line of the macro sets the Enable_Button2 variable to TRUE. Then, because Enable_Button2 is now TRUE, Button2 then becomes ENABLED.
I am trying to apply this strategy to a ComboBox, ListBox and CommandButtons. I'm not sure what event to trigger on to poll the Enable_Button2 to enable/disable the control.
I'm currently building an Excel database. This database has a few comboboxes and checkboxes that are tied to each other. If I select the combobox option of "Years", the "Quarters" combobox must be greyed out. In addition depending on which option is chosen, the relevant check boxes must be enabeled or disabled. I've written some code which runs fine, until I try and activate another macro button or if I add and rename a sheet(which is not linked to anything). What should I do? Here is a sample of my code. I have a feeling it's really obviouse but I cant see it..
I am trying to allow uses of a spreadsheet to be able to select one control button which would in turn disable another one via check boxes however the control buttons do not re-enable when the undo check box is selected.
Is it possible to disable all Excel functions? not as in disable calculation, but actually make Excel's standard functions not available in a workbook.
My reason for wondering if this is possible is that I would like to write UDFs that perform special actions in addition to the typical Excel functions, but give them the same name as their Excel counterparts... essentially create polymorphisms / overloaded Excel functions.
I have a spreadsheet which has extra worksheets at the end that the user can move around, if they need them.
Then i found out that users were adding there own sheets, so i protected the workbook, but i found out that this stops the user from moving the sheet.
Whats the easiest way probably using code to disable the worksheet functions, ie the ones that appear if you click on the tab (insert,delete,rename,move+copy,select all sheets etc) but still allow the user to move the sheet within the workbook
Need code or way of disabling the Right Click feature in Excel? I think you can change it in the computer settings but I only want to disable it for a particular workbook so I am hoping there is a VBA Code that will tell the user "Right Click Not Allowed, Please use Cut and Paste or Ctrl +V and Ctrl +C"
Question regarding the disabling of right mouse button click options and have used the code below to disable and reciprocal code to enable options. The code works well in Excel 2003 but have recently used the spreadsheet in excel 2000 and the code causes a runtime error 5 'Invalid procedure call or argument'. how to amend the code to have it also work with Excel 2000.
I have a workbook with multiple charts in and will be available to others to use but I want to disable the ability for them to be able to right click on a chart and make any alterations. I cannot lock out the page due to other things that I have going on. I also need to reverse this code when they close the workbook down so it does not affect any other workbooks