Making some rows uneditable

  • Thread starter Thread starter sameerce
  • Start date Start date
S

sameerce

Hi,
I wanted only some rows to be non editable by the user and rest of th
rows should be editable. I know that this is possible using th
protection option, but in this case it locks the whole worksheet. I wa
to lock only certain ranges in the worksheet without having to give an
password.
How can this be done?

Thanks,
Samee
 
Hi Sameer

Protection locks everything that you haven't spesifically marked "not
locked". So that's what you have to do, there are no "just a little
protection" methods anywhere.
 
Hi sameerce;
For example (the user is likely to be surprised)

Dim oldCell As String

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If oldCell = "" Then oldCell = "A1"
Select Case Target.Row
Case 10, 12, 14, 16, 21 To 23: Range(oldCell).Select
Case Else: oldCell = Target.Address
End Select
End Sub

MP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top