ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Lock and protect cells without protect the sheet (https://www.excelbanter.com/excel-programming/319654-lock-protect-cells-without-protect-sheet.html)

Christian[_7_]

Lock and protect cells without protect the sheet
 
Dear experts,

I would like lock and protect cells without protect the sheet.

Thank You

Christian



Frank Kabel

Lock and protect cells without protect the sheet
 
Hi Christian
not possible. But why do you want to do this anayway?.


"Christian" wrote:

Dear experts,

I would like lock and protect cells without protect the sheet.

Thank You

Christian




Norman Jones

Lock and protect cells without protect the sheet
 
Hi Christian,

Whilst the locked property of the cells can be set, the locking (and
protection) is only activated when the sheet is protected.

What are you trying to do exactly?

---
Regards,
Norman



"Christian" wrote in message
.. .
Dear experts,

I would like lock and protect cells without protect the sheet.

Thank You

Christian




Sharad

Lock and protect cells without protect the sheet
 
Not possible as such.
If you want to protect the cells from users i.e. ser manually should not
be able to change the cell values or any other properties then you can
add a code in that sheet's Selection Change.

By default all the cells in the worksheet are locked, but not formuala
hidden.
For the cells which you want to protect (from the users), go to Format
Cells and on Protection Tab check the box 'Hidden'. Below code will not
allow the user to selct cell (or a range including the cell) for which
the Hidden box is checked.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim c
Application.EnableCancelKey = xlDisabled
For Each c In Target.Cells
If c.FormulaHidden Then
c.Offset(0, 1).Select
MsgBox "The cell left to the now selected cell" _
& "is protected and you can't select it."
Exit For
End If
Next c
Application.EnableCancelKey = xlInterrupt
End Sub

If you yourself want to change back the hidden box to unchcecked enter
in design mode first then you can change
(and mind you, so can a user if he knows enough!)
Sharad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Patrick Molloy[_2_]

Lock and protect cells without protect the sheet
 
actually, it IS possible.

Go to the IDE, and in the Project Viewer, select the sheet that you want to
portect. Select the Properties Window and you'll see a proprty called
"ScrollArea"
This is the range that the cursor can move in. Usually left blank, but you
could setthis to a cell, like A1
or A1:G5
the effect limits where the user can select....so your data can only be seen
and th eformula remains hidden... and obviously a cell cannot be changed if
it cannot be selected !

Not widely used, but its a good way to "protect" data.


"Christian" wrote:

Dear experts,

I would like lock and protect cells without protect the sheet.

Thank You

Christian




Sharad Naik

Lock and protect cells without protect the sheet
 
Wow! That's so simple!
Though this can not be assigned to non continuous range,
I don't know if the OP can use this but
I found it very useful, in many of my templates, I need to give
the user access only to a certain (continuous) range.
And with what you told, even if the user goes to design mode, it
still work!

Thanks
Sharad

"Patrick Molloy" wrote in message
...
actually, it IS possible.

Go to the IDE, and in the Project Viewer, select the sheet that you want
to
portect. Select the Properties Window and you'll see a proprty called
"ScrollArea"
This is the range that the cursor can move in. Usually left blank, but you
could setthis to a cell, like A1
or A1:G5
the effect limits where the user can select....so your data can only be
seen
and th eformula remains hidden... and obviously a cell cannot be changed
if
it cannot be selected !

Not widely used, but its a good way to "protect" data.


"Christian" wrote:

Dear experts,

I would like lock and protect cells without protect the sheet.

Thank You

Christian






Christian[_7_]

Lock and protect cells without protect the sheet
 

"Sharad Naik" ha scritto nel messaggio
...
Wow! That's so simple!
Though this can not be assigned to non continuous range,
I don't know if the OP can use this but
I found it very useful, in many of my templates, I need to give
the user access only to a certain (continuous) range.
And with what you told, even if the user goes to design mode, it
still work!

Thanks
Sharad

"Patrick Molloy" wrote in
message ...
actually, it IS possible.

Go to the IDE, and in the Project Viewer, select the sheet that you want
to
portect. Select the Properties Window and you'll see a proprty called
"ScrollArea"
This is the range that the cursor can move in. Usually left blank, but
you
could setthis to a cell, like A1
or A1:G5
the effect limits where the user can select....so your data can only be
seen
and th eformula remains hidden... and obviously a cell cannot be changed
if
it cannot be selected !

Not widely used, but its a good way to "protect" data.


"Christian" wrote:

Dear experts,

I would like lock and protect cells without protect the sheet.

Thank You

Christian


Thank You,

Christian




All times are GMT +1. The time now is 12:45 AM.

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