View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sharad Sharad is offline
external usenet poster
 
Posts: 123
Default Protect certain cells


This can not be done, by setting some properties in excel, and you will
need to look for a work around.

One of the possible work arround could be writing a code in that
Worksheet_SelectionChange event procedure.
Just for example, if the cells you want to protect are in say column E
then

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableCancelKey = xlDisabled
If Target.Column = 5 Then
Target.Offset(0, 1).Select
Msgbox "Please leave that cell alone."
End If
Application.EnableCancelKey = xlInterrupt
End Sub

You can accrodingly modified the code for cells you want to protect.

Sharad

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