Select Cell within range
When you protect the sheet (assuming you are using XL2002 or better) then you
get a dialog that ask you how you want to protect the sheet. One item is the
ability to select locked cells. If you uncheck that then the user can not
select any cell you have locked.
As for displaying a user form you can either use a button or one of the cell
events. Selection chage can work as you have suggested. That will fire
whether or not the mouse, enter key or arrows are used. you could use the
double click event. In that case (IMO a better option) you can only pop the
form with the mouse...
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Address = "$B$2" Then
Cancel = True
UserForm1.Show
End If
End Sub
--
HTH...
Jim Thomlinson
"ranswrt" wrote:
I am try to write a procedure to start a userform when a cell is clicked. I
am using the selection change event in the worksheet. I need to keep the
cells locked to protect the contents in them. Is there a way to protect the
sheet but only allow cells within a range to be selected not all the cell on
the worksheet? Or is there another way to have userform start up by clicking
or double clicking a cell?
Thanks
|