Excel - Disabel ability to manually change sheets (but don't hide them) - excel

Apologies if this is a really stupid question but I've not been able to find a solution.
I've got a main page on my Excel workbook with a number of filter options and some buttons linked to vba code. When clicking the button it takes you another tab with a load of data filtered appropritately. There is a button there that removes the filters and takes you back.
This all works fine but what I want to do is stop people being able to manually change sheets but clicking on the tabs at the bottom of the screen. So far the only method I've found is hiding them, but this obviously doesn't work as you then can't see that data.

You can disable the editing of the sheet tab names by turning them off on the excel options as mentioned in the comment above. The downside to this approach is the user won't be able to see what sheet they are on (which I find incredibly frustrating).
The better method in my mind is to set up an event listener for when the user changes the name of the tab. You can then send a pop up box that appears when the user attempts to change the tab name.

Related

What causes scrolling to be disabled in an excel worksheet?

I apologize because I feel like I am asking a silly question that I should know the answer to.
I'm wondering what I have done to make it so that one of my worksheets within a workbook does not allow me to scroll.
Some things that might be important
This worksheet contains command buttons. The command buttons are used to add rows to tables
One of the command buttons moves all the other command buttons to align them nicely
this worksheet contains tables
What I have tried and so no change
I tried duplicating the worksheet and deleting all the command buttons
In the duplicated worksheet I converted all tables to ranges
I made sure I didn't have frozen rows/columns
What I tried and maybe learned something?
I tried selecting all cells and pasting in another page, when I pasted with values I could scroll, when I pasted with sourse formatting I could not. This makes me think it is related to some formatting but I am not sure what specifically.
There're a list of items that could be going on...
Scroll lock could be on
You set .screenupdating=false
You are showing a userform that has mode
You have so much memory in use that Excel disabled its display, e.g., you can still debug.print in VBA, but the window doesn't scroll while in the instance (and you can save).
Those are some quick heavy hitters, but without having details about what is in your sheet (most of which probably can't be easily shared in a post), nothing can be said definitively.
As such, this is a subjective/speculative question as is and should be closed.

activeX combo boxes

I have a complex workbook that has a number of ActiveX Combo boxes which I choose over form controls for their customization options. Inexplicably, ALL of the boxes stopped working this morning. Literally, one minute they worked and then stopped completely. I was not working on that sheet, but rather a different one. There is no code attached to the combo boxes. When in design mode, the properties box doesn't even come up. Developer>Properties opens the worksheet properties only. This problem is not associated with the workbook because older versions of the same sheet are acting the same way. However, the compiled version of the workbook works fine. This suggests corruption in Excel somehow, so I repaired Excel (Office 365). No difference.
I deleted the combo box and replaced it and it is ok now, but that's not good enough for me. I have many others to remove and replace, but why do I need to do this? There are 180 other boxes that this happened to in the past and I simply used Data Validation for because I could not have this happen. I distribute this workbook in a compiled version only, so if I was certain that this bizarre occurrence could not happened once its compiled, I will replace all of the boxes that don't work and replace all of the data validation boxes with activeX, and compile it immediately. But I like things to make sense. What the heck is going on?
An ActiveX combo box has it's code on the sheet module for the sheet it is in. So, it's not odd that looking for the properties of the combo box that the sheet module would pop up. When in design mode and you right click on the combo box a pop up menu should come up that allows you to click and see the box's code on the sheet module. Are you saying that all the code for the boxes vanished or you had never written it? How do they get populated? I apologize for commenting in the answer section but I don't have enough points yet to write in the comment section.
The fact that no one has answered this suggests that this is behavior that I am causing. My belief at this point is that there is code running in the background which suspends other activity. I have a pop up calendar that ends with a range selection. I believe that this is looping somehow.
I am going to replace the data validation boxes with more combo boxes throughout the sheet with the calendar code in mind.

excel initialize 'protect/unprotect sheet' with a userform

I have made an Excel file in which operators from a manufacturing company can log malfunctions/failures or anything that stops production. The way an operator logs a malfunction, is by clicking on a button on one sheet, that opens a userform created with VBA in Excel.
The operator fills in all the required fields through dropdown menus (operators' name, team, malfunction type, machine name, etc). When the operator is finished, he or she can press on the save button which will write all the data to another sheet in a standardized way, so it is ready to be used for data visualization.
The problem
Some operators do not use the userform to log a malfunction, but type directly into the data sheet, which contradicts the logging of malfunctions in a standardized way. Simply hiding the sheet, or putting a password on it is not an option, because operators must be able to see all the logged malfunctions by others as well.
Possible solution
I have been thinking and the only solution to solve this, is to make the data-sheet readonly. But the problem that occurs then, is that the userform isn't able to put the data into the sheet as well. So i think the best way to solve this, is to put a readonly on the sheet at all times, but when the userform opens, the sheet is unprotected (so it can save the data on the sheet), and when the userform is closed it will be readonly again. Feel free to ask if you need anything.
Thanks in advance.
The Worksheet.Protect method has an option to only stop the user from changing data on the sheet. set UserInterFaceOnly to True:
Worksheet.Protect Password:="randompass" UserInterfaceOnly:=True
Then the code can change the data but the user can't

How to delete a large number of command buttons in excel

I have a macro that I have designed to retrieve information from the internet and then to process that information into formats I want. My first worksheet in the workbook functions as my command page and all of the subsequent worksheets are populated based on what I tell the command page I want.
I have assigned control buttons on the command page to all of the various functions I want the macro to execute on the data retrieved from the web so I can select which functions I want applied. However, I believe that somewhere along the way I told my code to make copies of 1 certain command button.
There are now over 7000 command buttons for one function. Thank fully they are all stacked on one another so it isn't obvious, however it is starting to slow my excel down.
Is there any way to manage all of you buttons and then to select the ones you wish to delete?
Maybe a macro that deletes all duplicate command button names would do the trick? Before I tried this method, I wanted to see if there was an easier fix to my problem.
This should work for you:
Shift+Ctrl+Click on the button to select it
Press Ctrl+a to have it select all of them
Then Ctrl+Click the button to de-select the top-most button
Press the Del key to delete all selected objects.

Excel Listbox in a Sheet with FreezePanes

I have an Listbox Multiselect ActiveX control in a Sheet with Freeze Panes. The problem is that when I try to select items the mouseover icon is the standard excel cross instead of the arrow. I know that this question was asked before, but I didn't find any answer.
Thank u in advanced for help
I tested, and I came up with a few interesting observations.
In the ribbon, go to the developer tab. Make sure that the Design
Mode is not on.
When I first froze panes on the sheet, the freeze line went through the listbox I created. This caused the behavior you are describing with the cross-hairs and being unable to select.
Then I moved the listbox. Still same problem. I tried clicking on various cells around the sheet and in the ribbon area, with no change in behavior.
When I clicked to another sheet and back again, it started working as expected. Normal pointer mouse. I could select multiple, and unselect as needed.
Based on what I've tried, it seems that making sure Design Mode is off, and clicking to another sheet and back again may fix the problem.

Resources