ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unlocking Macro in protected sheet (https://www.excelbanter.com/excel-programming/344098-unlocking-macro-protected-sheet.html)

mag7417

Unlocking Macro in protected sheet
 

A simple question:

- I have a rather large sheet with a lot of data in it.
- In order to simplify sorting I recorded a few macros.
- Since it is for government use I know a lot of people will be using
it who don't know how not to change data that shouldn't be changed, I
have protected the sheet.
- Before locking the sheet I changed the properties of the cells that
they should be able to change, unchecking the lock box.
- When running the simple sorting macro VB tells me that I need to
unlock the sheet even though the cells containing the macros are
unlocked.

Anyone got a tip on how I can get around this? I.e. I need to have the
sheet protected while at the same time I want the macros activated.


--
mag7417
------------------------------------------------------------------------
mag7417's Profile: http://www.excelforum.com/member.php...o&userid=28413
View this thread: http://www.excelforum.com/showthread...hreadid=480088


Sprout

Unlocking Macro in protected sheet
 

Your macro may be trying to update cells in your worksheet. It will not
be able to do this if these cells are locked. e.g. If your macro carrys
out a goal seek, changing one cell to match another, it will only do
this if the cell it needs to change is not protected. i.e. it can write
to this cell. Therefore what you need to do is unlock any cells which
your macro needs to write to.
Hope this helps.


--
Sprout
------------------------------------------------------------------------
Sprout's Profile: http://www.excelforum.com/member.php...o&userid=26411
View this thread: http://www.excelforum.com/showthread...hreadid=480088



All times are GMT +1. The time now is 10:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com