View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Howard31 Howard31 is offline
external usenet poster
 
Posts: 100
Default Error coding for access of locked cells...

Hi gab1972,

In the code module associated with the sheet which is protected in the
BeforeDoubleClick event write Cancel = True that should solve the problem

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
End Sub

This will make that double-clicking has no affect at all, however if the
user will try to edit a cell he'll get the message as you've mentioned but he
will not be taken to a different sheet
--
A. Ch. Eirinberg


"gab1972" wrote:

I have a sheet where all of the cells are locked. The cells are
populated from a separate sheet. I'm beta testing my workbook and
when I *double-click* a locked cell, I get a message box that says the
cell is locked and that you must remove the password
(...blah...blah..blah...) and then it takes me to the sheet that
populates the cell. I don't want this to happen. Do I need some sort
of Worksheet Change coding that keeps the user on that sheet??

Thanks in advance!