Stop from Selecting a Protected Cell

  • Thread starter Thread starter Ron de Bruin
  • Start date Start date
R

Ron de Bruin

Hi Robin

You can do it with VBA code

If you copy this event in the Thisworkbook module
http://www.mcgimpsey.com/excel/modules.html

It will run automatic when you open the workbook and
Protect each sheet in the workbook and set the EnableSelection

Test it on a test workbook

Private Sub Workbook_Open()
Dim Sh As Worksheet
Application.ScreenUpdating = False
For Each Sh In ThisWorkbook.Worksheets
Sh.Select
Sh.Protect userinterfaceonly:=True
Sh.EnableSelection = xlUnlockedCells
Next
Sheets(1).Select
Application.ScreenUpdating = True
End Sub
 
Hi all,

I am using XL2002.
I have protected a cell by locking it - Format Cells>Protection tab>Locked.
Then, I protect the worksheet - Tools >Protection>Protect Worksheet>without
ticking on either Select Locked Cell or Select Unlocked Cell>type the
password>OK.
Then, I save the workbook.

I protect the cell so that users cannot change the formula in it or even
select the cell.
I save the workbook.

BUT when I open that workbook in other computers (with Excel 97/2000/2002),
I can still able to select that cell eventhough I cannot write in it.

Why does this happen? How to protect the cell so that it CANNOT BE SELECTED
(highlighted) in any pc using any Excel version?

Thanks for your advice.

Warmest regards,
Salza
 
Robin
If your objective is to prevent the users from seeing the formula you can do this by checking "Hidden" on the cell format protection tab (at least in Excel 97). Then when the user selects the cell, the formula bar will be blank, but the calculated value will still show in the cell

Regards
Mark Graesse
(e-mail address removed)

----- Robin wrote: ----

Hi all

I am using XL2002
I have protected a cell by locking it - Format Cells>Protection tab>Locked
Then, I protect the worksheet - Tools >Protection>Protect Worksheet>withou
ticking on either Select Locked Cell or Select Unlocked Cell>type th
password>OK
Then, I save the workbook

I protect the cell so that users cannot change the formula in it or eve
select the cell
I save the workbook

BUT when I open that workbook in other computers (with Excel 97/2000/2002)
I can still able to select that cell eventhough I cannot write in it

Why does this happen? How to protect the cell so that it CANNOT BE SELECTE
(highlighted) in any pc using any Excel version

Thanks for your advice

Warmest regards
Salz
 
Back
Top