can v lock column

  • Thread starter Thread starter ilyaskazi
  • Start date Start date
I

ilyaskazi

how to lock any specified column or row in excel or through vba??

I don't require any splitting / freezing panes.

If locked, user should not able to edit/delete any of the cells of
locked column or row.
 
1. Select al cells, click Format > Cells > Protection tab and uncheck
the Locked tab.
2. Slecte the cells / columns / rows which you want to lock. Go to
Format > Cells > Protection tab and check the Locked tab.
3. Now go to Tools > Protection > Protect sheet. You may supply a
password if needed.

Mangesh
 
Sub Test()
With Sheets(2)
..Cells.Locked = False
..Columns("C:C").Locked = True
..Protect
End With
End Sub

HTH. Best wishes Harald
 
Add rows to Haralds code:

Sub Test()
With Sheets(2)
..Cells.Locked = False
..Columns("C:C").Locked = True
..Rows(2:6).Locked = True
..Protect
End With
End Sub

MIke F
 

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