Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Allowing row deletion in worksheet with locked cells
I have a need to create an Excel file that has one column that contains
values that I don't want the user to be able to change, however, they can add new rows (the locked column would be blank) and delete rows. I unlocked the columns that they can manipulate, locked the one column and then when I protected the worksheet I said to allow users to insert and delete rows. I can add a row but I cannot delete a row. It tells me that the row has a locked cell and I must remove worksheet protection before I can delete the row. Is there a way to lock column values but still be able to delete the row? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Allowing row deletion in worksheet with locked cells
You need VBA
Add a button with the code: Sub DeleteRowAtSelectedCell() 'warning. will delete 'every row in the range selected 'without undo PW = "thepassword" ActiveSheet.Unprotect Password:=PW Selection.EntireRow.Delete ActiveSheet.Protect Password:=PW End Sub You could add a message box to tell the user what s/he is about to do and seek confirmation but it remains dangerous. -- Lil ?B?TVQ=?= wrote in : I have a need to create an Excel file that has one column that contains values that I don't want the user to be able to change, however, they can add new rows (the locked column would be blank) and delete rows. I unlocked the columns that they can manipulate, locked the one column and then when I protected the worksheet I said to allow users to insert and delete rows. I can add a row but I cannot delete a row. It tells me that the row has a locked cell and I must remove worksheet protection before I can delete the row. Is there a way to lock column values but still be able to delete the row? -- |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Allowing row deletion in worksheet with locked cells
"Liliana" wrote: You need VBA Add a button with the code: Sub DeleteRowAtSelectedCell() 'warning. will delete 'every row in the range selected 'without undo PW = "thepassword" ActiveSheet.Unprotect Password:=PW Selection.EntireRow.Delete ActiveSheet.Protect Password:=PW End Sub You could add a message box to tell the user what s/he is about to do and seek confirmation but it remains dangerous. -- Lil ?B?TVQ=?= wrote in : I have a need to create an Excel file that has one column that contains values that I don't want the user to be able to change, however, they can add new rows (the locked column would be blank) and delete rows. I unlocked the columns that they can manipulate, locked the one column and then when I protected the worksheet I said to allow users to insert and delete rows. I can add a row but I cannot delete a row. It tells me that the row has a locked cell and I must remove worksheet protection before I can delete the row. Is there a way to lock column values but still be able to delete the row? -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Locked worksheet & hyperlinks (w/ select locked cells unchecked) | Excel Discussion (Misc queries) | |||
Allowing editing locked cells in a protected sheet in excel | Excel Worksheet Functions | |||
ALLOWING ONLY DATA INSERTION IN LOCKED CELLS | Excel Discussion (Misc queries) | |||
Merge two files and then allowing deletion of duplicate cells? | Excel Worksheet Functions | |||
Across a worksheet, which cells I have formatted as locked? | Excel Worksheet Functions |