ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Password protect worksheets (https://www.excelbanter.com/excel-programming/397583-password-protect-worksheets.html)

Jock

Password protect worksheets
 
I spotted in my travels in this forum that someone referred to 'locking the
sheets' in a workbook. I like the sound of that! So, for instance, in a
workbook with seven sheets, five could be locked leaving two open to all
users.
How would I go about it???
--
Traa Dy Liooar

Jock

Dave Peterson

Password protect worksheets
 
You can protect a worksheet via:
tools|Protection|protect sheet

But first you may want to lock or unlock different cells on each of those
worksheets.

Unless you've done something strange, all your cells will be locked. You can
select the cells that you want users to change and then Format|cells|Protection
tab|uncheck locked

Then protect the worksheet. Depending on the version of excel that you're
using, you may see a bunch of options that allow you to let users do stuff with
locked cells on a protected sheet.

But a couple of things to remember: Worksheet protection is easily broken and
there are lots of things that may not work on a protected worksheet. You may
want to do some testing before you share your workbook with others--just to make
sure it works as intended.

Jock wrote:

I spotted in my travels in this forum that someone referred to 'locking the
sheets' in a workbook. I like the sound of that! So, for instance, in a
workbook with seven sheets, five could be locked leaving two open to all
users.
How would I go about it???
--
Traa Dy Liooar

Jock


--

Dave Peterson

Jock

Password protect worksheets
 
Hi Dave, thanks.
I have noticed in the past that a protected sheet does indeed have an impact
on formulae and code which try to access it. What I was looking for was
either:
a) a method of 'hiding' tabs which I don't want people to access. This would
mean the sheet could remain unlocked, thus allowing code etc to run without
problems,
b) Code to run when a tab is clicked which will ask for a password before
displaying the sheet. Again the sheet wouldn't need to be locked.
Any ideas?
--
Traa Dy Liooar

Jock


"Dave Peterson" wrote:

You can protect a worksheet via:
tools|Protection|protect sheet

But first you may want to lock or unlock different cells on each of those
worksheets.

Unless you've done something strange, all your cells will be locked. You can
select the cells that you want users to change and then Format|cells|Protection
tab|uncheck locked

Then protect the worksheet. Depending on the version of excel that you're
using, you may see a bunch of options that allow you to let users do stuff with
locked cells on a protected sheet.

But a couple of things to remember: Worksheet protection is easily broken and
there are lots of things that may not work on a protected worksheet. You may
want to do some testing before you share your workbook with others--just to make
sure it works as intended.

Jock wrote:

I spotted in my travels in this forum that someone referred to 'locking the
sheets' in a workbook. I like the sound of that! So, for instance, in a
workbook with seven sheets, five could be locked leaving two open to all
users.
How would I go about it???
--
Traa Dy Liooar

Jock


--

Dave Peterson


Dave Peterson

Password protect worksheets
 
A.
Select the sheets you want to hide.
Format|Sheet|Hide
But the user can use the same technique to unhide those sheets. You can protect
the workbook's structure so that no sheets can be
moved/deleted/inserted/hidden/shown via:
tools|Protection|protect workbook|Check Structure

But be aware that this password is easily broken. And really interested person
can find a way around it.

B.

Jock

Password protect worksheets
 
The data isn't confidential at all, but rather I don't want people to
'fiddle' around and delete or change things whether inadvertantly or
otherwise!
So I'm going to run with your A. suggestion.
Thanks
--
Traa Dy Liooar

Jock


"Dave Peterson" wrote:

A.
Select the sheets you want to hide.
Format|Sheet|Hide
But the user can use the same technique to unhide those sheets. You can protect
the workbook's structure so that no sheets can be
moved/deleted/inserted/hidden/shown via:
tools|Protection|protect workbook|Check Structure

But be aware that this password is easily broken. And really interested person
can find a way around it.

B.
There's not a real good way to do this. Any solution (that I would use) would
involve macros and macros can be disabled (and events can be disabled, too).

In fact, if you have information that is really private and shouldn't be seen by
others, then excel isn't the application you should use. But if you have to use
excel, then don't share the workbook with anyone you don't trust.



Jock wrote:

Hi Dave, thanks.
I have noticed in the past that a protected sheet does indeed have an impact
on formulae and code which try to access it. What I was looking for was
either:
a) a method of 'hiding' tabs which I don't want people to access. This would
mean the sheet could remain unlocked, thus allowing code etc to run without
problems,
b) Code to run when a tab is clicked which will ask for a password before
displaying the sheet. Again the sheet wouldn't need to be locked.
Any ideas?
--
Traa Dy Liooar

Jock

"Dave Peterson" wrote:

You can protect a worksheet via:
tools|Protection|protect sheet

But first you may want to lock or unlock different cells on each of those
worksheets.

Unless you've done something strange, all your cells will be locked. You can
select the cells that you want users to change and then Format|cells|Protection
tab|uncheck locked

Then protect the worksheet. Depending on the version of excel that you're
using, you may see a bunch of options that allow you to let users do stuff with
locked cells on a protected sheet.

But a couple of things to remember: Worksheet protection is easily broken and
there are lots of things that may not work on a protected worksheet. You may
want to do some testing before you share your workbook with others--just to make
sure it works as intended.

Jock wrote:

I spotted in my travels in this forum that someone referred to 'locking the
sheets' in a workbook. I like the sound of that! So, for instance, in a
workbook with seven sheets, five could be locked leaving two open to all
users.
How would I go about it???
--
Traa Dy Liooar

Jock

--

Dave Peterson


--

Dave Peterson



All times are GMT +1. The time now is 11:58 AM.

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