ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Setting up protection on a workbook (https://www.excelbanter.com/excel-worksheet-functions/216067-setting-up-protection-workbook.html)

brown1965

Setting up protection on a workbook
 
I am setting up a workbook and I am wondering if you can put protection on it
to prevent some users from inserting / deleting rows but allow other users
(people that will be doing maintenance on the file) to delete / insert rows
without having to remove the protection every time?

Gary''s Student

Setting up protection on a workbook
 
You should simply use password protection, but if you want to avoid the
manual effort of disabling and then re-enabling protection, you can use the
workbook open event macro:

Private Sub Workbook_Open()
If Environ("username") = "James" Then
' clear desired workbook and worksheet protections
Else
' set desired workbook and worksheet protections
End If
End Sub

or something similar
--
Gary''s Student - gsnu200825


"brown1965" wrote:

I am setting up a workbook and I am wondering if you can put protection on it
to prevent some users from inserting / deleting rows but allow other users
(people that will be doing maintenance on the file) to delete / insert rows
without having to remove the protection every time?


Shane Devenshire[_2_]

Setting up protection on a workbook
 
Hi,

The answer to this question might be more complicated if you are 1. Only
trying to allow the users to insert and delete rows, 2. If different users
can work with different ranges only.

In the second case you might consider the Tools, Protection, Allow Users to
edit range option.

In the first case you should consider VBA which prompts users for a password
or logon name and then sets the protection to allow only inserting and
deleting rows. With this routine you will need to add a before save or
before close macro which resets the protection back to complete.

If the users who can modify the workbook can make any modifications and
those that can't, can't make any modifications, then you might consider Read
Only with a password.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"brown1965" wrote:

I am setting up a workbook and I am wondering if you can put protection on it
to prevent some users from inserting / deleting rows but allow other users
(people that will be doing maintenance on the file) to delete / insert rows
without having to remove the protection every time?



All times are GMT +1. The time now is 03:42 PM.

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