Orange_Wed
08-13-2008, 03:22 PM
Hello all,
I'm in the process of trying to lock down a specific range of cells so that users cannot edit the contents. I have tried locking the range using the standard sheet protection in Excel and that works *except* for when a user needs to insert a row into the sheet.
I have attempted using the Worksheet_SelectionChange event to detect when a user selects a cell within the range, divert the selection a column to the right, and pop a message box indicating that the user cannot edit the cell selected. Once again, I have done not, as my attempt failed.
The range I am trying to lock down is F10:F102, and I need to be able to insert and delete rows, and manipulate the data contained in the range with a macro but I do not want users able to edit the information manually.
Can anyone give me some pointers? Maybe a smidge of code? This is the final result of my research, and it does absolutely nothing.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$F$10,$F$102" Then
Target.Offset(, 1).Select
MsgBox "Cannot Edit Cell"
End If
End Sub
Any help is most appreciated.
Wednesday
I'm in the process of trying to lock down a specific range of cells so that users cannot edit the contents. I have tried locking the range using the standard sheet protection in Excel and that works *except* for when a user needs to insert a row into the sheet.
I have attempted using the Worksheet_SelectionChange event to detect when a user selects a cell within the range, divert the selection a column to the right, and pop a message box indicating that the user cannot edit the cell selected. Once again, I have done not, as my attempt failed.
The range I am trying to lock down is F10:F102, and I need to be able to insert and delete rows, and manipulate the data contained in the range with a macro but I do not want users able to edit the information manually.
Can anyone give me some pointers? Maybe a smidge of code? This is the final result of my research, and it does absolutely nothing.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$F$10,$F$102" Then
Target.Offset(, 1).Select
MsgBox "Cannot Edit Cell"
End If
End Sub
Any help is most appreciated.
Wednesday