View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Need macro for protecting individual rows in a worksheet

If you need this in VBA, use code like the following:

Sub AAA()
Cells.Locked = False
Rows(1).Locked = True
Rows(3).Locked = True
Rows(5).Locked = True
ActiveSheet.Protect
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Chip Pearson" wrote in message
...
By default, all cells are Locked, so when you protect the
sheet, all cells are protect. Click on the Select All button
(the gray box above the row numbers, to the left of the column
letters), go to the Edit menu, choose Cells, the protection
tab, and uncheck the Locked setting. Then, select the rows you
want to protect, go back to the Format dialog and check Locked.
Finally, protect your sheet.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Sri Ram" <Sri wrote in message
...
I have a concept in my project i which I have make some rows of
a worksheet
non-editable .i.e., read-only. I have tried many options but
everything gave
me error. I can protect a complete worksheet but not
individual rows. I would
like to know whether it is possible to protect certain rows of
a worksheet &
if so, what is the function to use?