Excel Problems


Posted by venu nair on July 12, 2001 11:14 PM


Is there any way of preventing cut , copy , or paste on a protected worksheet
Protection only prevents modification but allows cut copy .



Posted by Damon Ostrander on July 15, 2001 3:23 PM

Hi Venu,

Yes, you can effectively prevent cut and copy by preventing the user from selecting any cell other than a particular one you allow to be selected (probably an empty cell). You can do this using the worksheet's SelectionChange event to immediately set the selected cell back to the allowed cell. For example,

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
[a1].Select
End Sub

will prevent any cell other than A1 from being selected.

I hope this helps.

Damon

Is there any way of preventing cut , copy , or paste on a protected worksheet Protection only prevents modification but allows cut copy .