I have coded a user form to automatically unprotect a sheet, then protect it with a password after data is entered from the User Form. Works great. However, after it is protected through the User Form script, I cannot unprotect the sheet to edit it. It will not recognize that it is the correct password, although it is.
Private Sub cmdOK_Click()
Dim NextRow As Long
NextRow = Application.WorksheetFunction.CountA(Range("b:b")) + 2
Cells(NextRow, 2) = txtAddProvider.Text
ActiveSheet.Unprotect Password = "stats@fwh"
ActiveWorkbook.Worksheets("Lists").AutoFilter.Sort.SortFields.Add Key:=Range( _
"B3:B21"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
ActiveSheet.Protect Password = "stats@fwh"
I have made an excel sheet for multiple choice questions, in which person needs to click on submit button after completing with the test & pop up will say "Your score is__". Now, I want to want to add one more button named "Reset". I want below :
1. Person should not be able to make any changes after clicking on "Submit" button.
2. If one tries to click on "Reset" button, it should ask for password.
3. After keying password for "Reset" button, all questions should be reset so that next person can give test.
I have attached an example excel sheet for reference : DoM1.xlsmâ€Ž
I have a sheet that is password protected. I have this code attached to a command button. It will unlock the worksheet, autofilter it, print it, unfilter it, and password protect the sheet again. However it is protecting it without a password. I need to have it protected with the password so that someone will not be able to just go to tools to unprotect the sheet.
Private Sub CommandButton1_Click() ActiveSheet.Unprotect "rainforest" Columns("O:O").Select Selection.AutoFilter Selection.AutoFilter Field:=1, Criteria1:=">0", Operator:=xlAnd ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Selection.AutoFilter Field:=1 Selection.AutoFilter ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _ , AllowSorting:=True, AllowFiltering:=True End Sub
I currently have a macro which i run by selecting tools, macro, macro and then selecting the one i want and pressing run. if i press run I want a box to appear asking me to input a password and if password matches then run that specific macro, can this be done
I am seeking a method of password protecting worksheets in a workbook. The users would all start on a sheet that has their names (A1 - A10) next to their names would be where they type in their password (B1 - B10). If their password is correct their assigned worksheet (Worksheet2) would be unlocked for editing.
1) I need to have code to protect the sheet that my user form is writing to. In other words, when the information from the user form is populated to the sheet, I want that sheet protected by a password that I set where I can unlock it, but no one else can.
2) I need to protect my VBA code with a password, I do not know how to do this, I have looked everywhere. I do however think this is something simple and I will kick myself once I find out where it is.
I have a workbook that contains a series of macros designed to compare various reports and spit out a report. I don't want my users to have to insert a password, but I want to keep my workbook protected. I've already protected the macros in the VBA Properties, so those are pretty safe, but the worksheets in the workbook are susceptible to changes that will hose my macros.
Setting the workbook to "Read Only" in Properties on our shared drive helps, but any user can change that at will. Within Excel, going to Options, Security, I can set a password so no-one can modify that workbook, but that pops up a password box when they open the workbook. I'd like to NOT have the password box pop up unless I need to make changes. Is there a way to do that? I've looked on the internet but can't find a solution on this one.
I had the thought that maybe it would be possible to have a worksheet that is not protected when saved but when it is opened there would be a sub-routine under Sub_Workbook Open that would step through each sheet and assign a random password. And when the workbook is saved it is saved without passwords again.
In this way there would be nothing for a password cracker to pick at. The only flaw I see would be that the password to open the VBA module would need to be static and this would open up the programming to change and remove. But wouldn't this be effective against most users who would only know about the utilities to open the passwords and not the programming behind excel.
I have one workbook with different Tabs that are tied to a master sheet. Different offices are respondable for entering their office information I was hoping instead of seperating the tabs into different workbooks and linking to the master, I could password protect each office tab. Can this be done?
I have a Database and user form, in the user form i have a field named “Vehicle No” this is a combo box from which a user needs to select the Vehicle numbers, and all these are working fine now, I need your help in the following:
When user selects the second field named "Select Vendor name" i need a pop up window which shows all the Vehicles belongs to the vendor which they have selected, and with the popup window user selects the vehicle number then the Vehicle number combo box should be filled.
Currently users have to select by scrolling through Combo box which takes long time and difficult to find by scrolling.
I have a user form that has a combo box "City" two text boxes one called "Flight" and the other "Date". What I'm trying to do is to prevent the user from saving the data input from the user form if any of those three fields is left blank. The code that I have so far checks all of the required fields, if any are left blank a message notifys which field(s) is left blank and return the focus back to that field. But the rest of code also fires.
What I really need is either to stop the code if any fields are blank and return the focus back to the blank field, the user completes the field(s) and clicks the save again, or better yet, pause the code until all the required fields are completed and then complete the save. (There is actually another 200+ lines of code in this sub, but I deleted it to keep the post a little shorter.)
I was wondering if it was possible to hide cells using protect sheet? I have a worksheet that contains confidential data and would like it so the cells appeared blank unless you had the password. I know you can hide rows and columns but I need everything on the sheet to be hidden.
I have set a password under the permissions tab but all it does is protect the structure and not the content. I want all users to be able to view the file, but have to have the password to edit any of the sheets or data on the sheets. I can still protect the individual sheets, but that doesnt quite do what I want.
This question is related to my post here: http://www.excelforum.com/excel-programming/634024-cell-range-protect-unprotect-toggle.html
When you protect a worksheet via VBA then unprotect it the conventional way via: Tools>Protection>Unprotect Sheet. Why is it when you unprotect a worksheet in this way Excel does not ask you for a Password. You simpy only have to select Unprotect Sheet and the sheet is unprotected which for me kinda defeats the object.
I have recorded the following macro and wish to add unprotect (with password), run the macro - which formats the worksheet and then password protect all cells with the exception of range E15:H413 which I want to leave editable by users.