I have a spreadsheet with over a hundred tabs, each of which need to be password protected (same password).
I found code on CFO.com that got me half way there. It protects all the spreadsheets, but it does not password protect the macro itself, meaning that anybody can step into the macro and unlock everything at the click of a button.
The code looks like this.
For Each ws In ActiveWorkbook.Worksheets
MsgBox "All Worksheets Protected"
What can I do to prevent people from stepping into the macro, or prompt a password to actually use the macro itself?
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 have a excel file with around 8 sheets in it and this file puted in the network to be shared with 8 persons So i need to make an individual password for each one to enter to his specific sheet and have full authorization to make anything in it and this done using userform where each one when open the file in the network , a user form open in first stage to select his name and put his own password with the ability to let each one to make his own password or change it from the userform
this file is shared so it may more one user open it and it may be there an save funtion at same time ( same time & same activities )
I have a series of workbooks where multiple users are entering data. Most of the cells are locked, and the worksheets are password protected. From time to time, I have to make global changes to all the workbooks. I've recorded a macro to open all the workbooks, but now, I'm running into a problem because for speed, I'd like to unprotect the worksheets and "re-protect" them without having to enter the password 3 million times (exagerration, but not much). What is the proper syntax of code to have VBA enter the password automatically (it is the same for all sheets).
I have a workbook with 6 tabs. The workbook is designed to be shared but I want to password protect the last 4 sheets so that they can only be accessed by certain people. The people who have access need to be able to edit the sheet.
I am trying to create a way to protect and unprotect all sheets and the worbook by means of a Userform pop up interface.
I have managed to create the Userform but what the code will look like and where to place the VBA code that will make it work, Also i would like to automatically save the sheet/s as i switch between them. so that any updates made to the sheet will be automatically saved when i move to the next sheet and also when i protect or close the workbook.
I have an Excel 2007 workbook which has five sheets in. I just wondered whether it is possible to hide all five of them when the workbook is first opened. Also I would like the user to be asked for a password when they wish to unhide a sheet, with the password being different for each of the sheets.
Is there also a way to do this which won't be affected by Excel disabling all Macros when the application initially opens.
I have an annual leave (vacation) work book with a summary page work sheet and separate work sheets for each month i.e. Jan, Feb, Mar.....to......Dec. In order to protect the formulas I have protected them by allowing only access to the input cells on each work sheet and the protect each work sheet.
When someone either joins or leaves the team I have to manually unprotect each sheet and protect again when I have completed the amendments to each of the 13 tabs.
macro code I would need to unprotect all the works sheets in one go (as I use the same password for all the sheets) and reset the passwords (protect) the sheets with more macro code.
I will be running the two macros from my own personal.xls file and ideally they would be fully automatic i.e. I would not need to input the passwords in to unlock or lock the work sheets as the password would be written in the code already
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 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.
Stumbling over syntax on what should be easy. I want to password protect the active sheet using plain vanilla user input box; and then unprotect ALSO via an input box. Doesn't matter about masking the input with **** or whatever. Based on responses below, here is macro code I used:
To protect the sheet:
Sub ProtectSecurity() Dim pword As String pword = InputBox("Enter Password", "Password") ActiveSheet.Protect pword End Sub --------------------------------- To Unprotect the sheet:
Sub UnprotectSecurity() Dim pword As String pword = InputBox("Enter Password", "Password") ActiveSheet.Unprotect pword End Sub
I have been really trying to get this sorted myself and I can get it to work with one exception. I can't get the sheet to lock with a password. It locks, but if I try to unlock it again, it does so without prompting me to enter a password.
Essentially I am wanting to unprotect two sheets, unlock the cells that were previously locked (so users couldn't enter data in them when the sheet is protected), then reapply the same password to protect the sheet, but now they will be able to enter data in the unlocked range of cells).
The second macro is to reverse the changes made in the first and 're-lock' the unlocked cells) (and again apply the same password to the sheet).
How to protect multiple sheets in a workbook and not having to protect them 1 by 1. I have copied and pasted all the different macro's/visual basic script that has been posted for that purpose, but I can't get it to work and I'm always getting an error. The error from visual basic says "compile error: invalid outside procedure" and then the visual basic screen shows the following:
Range ("AM52") If Ans >= 0 Then "+."
It does not like the "AM52" part because it is highlighted in the error message.
Also, the error I get from recording my own macro step by step is "Run time error 40036" from visual basic.
I have a workbook where I password protect each sheet. Is there any way to quickly unprotect all sheets, make changes then protect all sheets. I cannot seem to do this by grouping multiple sheets. the option to unpropect/protect is not available.
i use a macro to protect several sheets in a workbook.
When i protect the sheets, i only want to be able to cells and nothing else. How should i mdify the code below to do this? I tried record the macro and un checking the "select locked cells" box which is one of the only 2 boxes checked. It works, but then when i save the wb and re-open it it allows me to select locked cells.
I'm trying to protect the contents of columns in multiple sheets in a workbook. I've tried to group the columns ( - months, i.e. sept, oct, nov 09 through to march 10) but when I go to Protection options the 'sheet' protection option is not available, all I can do is protect or unprotect the entire workbook.
I've also tried to protect the workbook, but individually set the specific columns in each sheet to be protected (repetitious but seemingly unavoidable), but this doesn't work well either as there's now a mix of a protected workbook and protected columns, both with individually set passwords to unprotect... which seems a bit silly.
There must be a way around this? - the columns are H, J, K and L, and the entire contents of the summary sheet '2009-10 Financial Year'... basically I'd like to be able to protect all of the contents of all of the cells here, ideally just with one password.
Is there an easy way (using a macro) to unprotect and protect sheets?
Most sheets in a certain workbook are protected except a few cells that are open for manual entry. Because I have links to other cells in other workbooks, I must unprotect those sheets/fields before I can edit the links. And I MUST ensure all sheets are protected again when I'm done with my work.
Also, is it possible to password-protect that specific macro so I'm the only one who can run it to unprotect and protect?
I have a Macro to protect all the Months sheets in my Time sheet to stop users deleting formulas, This year I've added a new sheet with a yearly calender so users can track Hols etc but when I run the Macro it protects this sheet "2007-2008". How can I amend the Macro so it protect all sheets except "2007-2008". My Macro is below:
Sub ProtectAll() Application.ScreenUpdating = False Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets ws.Protect Password:="KITCHENsink19591968", DrawingObjects:=True, Contents:=True, Scenarios:=False Next ws ActiveWorkbook.Protect Password:="KITCHENsink19591968", Structure:=True, Windows:=False Application.ScreenUpdating = True End Sub
I am trying to crack away to protect my workbook, by forcing users the enable macros on launching.
What I am trying to do is if Workbook_BeforeSave runs a routine called DoIt. This calls HideAll, saves, then calls ShowAll al whilst not updating. (ie so the user is non the wiser and the computer does not asked to save again if no changes are made).
The reason I am trying this is so that if the user closes the document, it will not ask them again to save. Instead it has preserved the state in the HideAll place (ie all important worksheets are VeryHidden.
It is only by enabling Macros on open can the ShowAll make them visible again.
Below is the code I am using and it works, except it seems the Application.EnableEvents = False in the DoIt macro does not seem to be doing what it should.
very dearly love to get an answer as it is driving me up the wall!
Public bIsClosing As Boolean Dim wsSheet As Worksheet
Sub HideAll() Application.ScreenUpdating = False For Each wsSheet In ThisWorkbook.Worksheets If wsSheet.Name = "Warning" Or wsSheet.Name = "Authorise" Then wsSheet.Visible = xlSheetVisible Else wsSheet.Visible = xlSheetVeryHidden End If Next wsSheet Application.ScreenUpdating = True...............................