Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
mt mt is offline
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default 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   Report Post  
Posted to microsoft.public.excel.misc
mt mt is offline
external usenet poster
 
Posts: 9
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Locked worksheet & hyperlinks (w/ select locked cells unchecked) dgold82 Excel Discussion (Misc queries) 1 July 10th 09 09:42 PM
Allowing editing locked cells in a protected sheet in excel phoenix[_2_] Excel Worksheet Functions 1 December 23rd 08 11:50 AM
ALLOWING ONLY DATA INSERTION IN LOCKED CELLS FARAZ QURESHI Excel Discussion (Misc queries) 2 December 27th 06 09:06 PM
Merge two files and then allowing deletion of duplicate cells? candygrl7300 Excel Worksheet Functions 2 August 10th 06 06:23 PM
Across a worksheet, which cells I have formatted as locked? ZM Excel Worksheet Functions 3 October 27th 05 01:34 PM


All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"