protect /macros

  1. J

    VBA to unlock sheet

    I have used vba code to lock the sheet, however, when I use the 'Unlock' code it seems to unlock the sheet regardless of the password being correct?? Sub LockSheet() Dim WS As Worksheet Set WS = Worksheets("Sheet1") WS.Protect Password:="123456" MsgBox "Data is locked" End Sub Sub...
  2. P

    Existing macro to password protect sheets has stopped working

    Hi all, I'm hoping someone can help me troubleshoot why a macro that has been in use for >4 years without any issues and hasn’t had any recent changes to the coding, has stopped working for some users while still working for me. The main purpose of the macro is to password protect each sheet...
  3. C

    Using AutoFilter macro on a protected worksheet? VBA- Excel

    I am using the ActiveSheet.Unprotect and Protect codes at the beginning of all my macros, there are 4 total in my workbook. All of them work, except the one AutoFilter code I have to clear contents of table rows based on 3 different criteria. For some reason, I get an error when it filters to...
  4. T

    VBA Toggle Button on Protected Sheet

    I am running this Macro to hide/unhide rows when form control button is clicked. Sub Important_Info_TOGGLE() Rows("24:42").EntireRow.Hidden = Not Rows("24:42").EntireRow.Hidden End Sub However when I protect the sheet it does not work. How can I fix this Macro so it runs when sheet is...
  5. S

    protect unwanted changes but still enable macros

    Hi all, I have a workbook with a worksheet for each employee to enter their productivity data. There are macros on each sheet to record timestamps and remove completed rows from the table. There is also a dashboard that uses a marco to query all the tables into a combined sheet and then...
  6. A

    Protect sheet and disable manual edits to pivot table but allow Slicers

    Not sure if this is possible but what i want to do is as follows: Unprotect sheet, refresh data on pivot table on sheet, filter out 3 items and then protect sheet. However after the sheet is protected I want it to be editeable by a Slicer but the user cannot manually override any data in the...
  7. O

    VBA code security

    Hi, I’m trying to find the best possible way to secure vba code in an excel spreadsheet. When I use the protect with password feature in Excel, I’ve found there are many videos on YouTube showing how to bypass that password (using a hex editor and some other methods). What would be the best...
  8. B

    VBA Code to Protect/Un-Protect Sheets asking for a password when there isn't one

    Hello Everyone, I wrote some code to protect/unprotect all of the worksheets in my workbook, and when I run the code in the vba editor it works perfectly fine. However, I added some shapes to my excel file and then assign the macros to those shapes, so the macro could be run at the click of a...
  9. N

    Macro to hide/unhide columns in multiple worksheets and protect/hide on close

    Hello I have limited knowledge with macros so would appreciate any advice you can give me. I have a Workbook that has several users - most only need to view the Workbook, others need to edit certain columns. I would the columns that need to be edited hidden on opening and only visible once...
  10. A

    Allow using Named Ranges of protected sheet as data source in pivot

    Hi Friends , I am using named ranges as data source in pivot. These named ranges can be selected by user from a combobox. I change data source of the pivot on the basis of named range selected from combobox. My code works fine if the sheet of the selected name range in combobox is unprotected...
  11. C

    Allowing Double Click to run code in protected sheet

    I've got a dilemma I am faced with. I have a sheet that has GETPIVOTDATA formulas that I have created a BeforeDoubleClick Event that opens a new sheet containing the data reflected in the GETPIVOTDATA via VBA code. It works without issues when I click the options to allow selection of locked...
  12. V

    Need cells to lock until a comment is added in the comment cell then unprotect sheet

    I am new to visual basic and need some help with some coding. I have a excel template that has an plan end date and actual end date (2 separate columns) if my actual end date is greater then my plan end date, I need a message box to explain they need to write a comment. If there is no comment...
  13. J

    VBA to copy current sheet (template) and make one sheet for each day of the month and protect it

    Hi, The title says it all. This is similar to my previous thread, but I would like to protect the sheet when its created from the template. I wont be using the sheet more than once a day. I also would like to carry over the closing balance of the items in the newest sheet, to the opening...
  14. D

    Making my spreadsheets "Hack Proof"

    Hello, I have a spreadsheet that is shared with people throughout the company, but what they can see and do with the spreadsheet is limited I have password protection on the VBA Project, the workbook, and all the sheets. I allow the users to interact with the spreadsheet through macros. When...
  15. E

    Need help to lock/unlock multiple sections of a worksheet as when clicked by user

    Hi guys, I am an excel savvy person, but not too expert like VBA or macro programmers. As such, I need some help on figuring out how to lock certain portions of my worksheet upon a click of a button. Imagine a 30-day calendar spread page. I need to have 30 buttons which will enable the user...
  16. M

    VBA to prompt when clicked on protected cell

    I have Workbook with both Sheet/workbook is protected. I have a code to lock/disable certain range of cells when the drop-down value "no" And unlock/enable when value of drop down is "yes" Whereas, drop-down value and cells I would like to disable are on different sheets. Dropdown on "Main...
  17. R

    The password you supplied is not correct. Verify that the CAPS LOCK key is off and be sure to use the correct capitalization

    I can protect and unprotect sheet using VBA but I can't unprotect using the normal way of excel and I am providing the same password. any help please? below are the codes Sheets("sheet1").Select ActiveSheet.Unprotect Password = "protect20" Sheets("sheet1").Select ActiveSheet.protect...
  18. C

    Protect and Unprotect Specific Worksheets

    Hello All, I would like a Macro/s that is/are able to protect and unprotect specific worksheets. This is so that other Macros can then access the data on these sheets. Currently I have a Macro, taken from another thread, that Protects and Unprotects all of the worksheets. This works fine...
  19. P

    Hiding/Protecting Specific Code in VBAProject

    Hey team -- Long time fan of Mr. Excel, but this is my first post and I hope that you can help me out! The code written helps me to determine if my students are sharing excel templates in order to submit less-than-honorably-produced assignments. I created some code to automatically log the...
  20. B

    protect/unprotect workbook macro

    Hi all I have the following macro in a module to protect/unprotect's working fine but i have a few columns "grouped" so when i try to "ungroup" them, it says, sheet is protected. i have tried to define it in the macro so not sure what I am doing wrong. I am using Excel 2013...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back