Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if you look at an individual cell's properties, there is a locked
checkbox on the last page. that is set by default, locking the cell when the sheet is protected. clearing that would allow the cell to be edited on a protected sheet. hope that gave you the insight you need. Sri Ram wrote: 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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried it but I am getting the error "Unable to set the locked property of
the range class" "Chip Pearson" wrote: 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? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The sheet must not be protected when you run the code. Try this:
Sub AAA() ActiveSheet.Unprotect 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 "Sri Ram" wrote in message ... I tried it but I am getting the error "Unable to set the locked property of the range class" "Chip Pearson" wrote: 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? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well Chip, do u know how to do this using VBA code.
"Chip Pearson" wrote: 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? |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See my reply to my post.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Sri Ram" wrote in message ... Well Chip, do u know how to do this using VBA code. "Chip Pearson" wrote: 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protecting/locking individual cells? + not displaying #N/A on cel | New Users to Excel | |||
protecting individual cells | Excel Discussion (Misc queries) | |||
protecting individual cells | Excel Discussion (Misc queries) | |||
Auto run macro on individual worksheet open | Excel Programming | |||
Protecting individual sheets | Excel Discussion (Misc queries) |