You can't react to the users attempt to delete rows with an event (it would
be after the fact - after the failure). So I don't see code as an option
unless you will add a custom menu item that. the user selects the rows,
then hits the menu item and you code kicks in to unprotect the sheet, delete
the selection, reprotect the sheet.
--
Regards,
Tom Ogilvy
"Paige" <(E-Mail Removed)> wrote in message
news

6F638AB-3A0A-4A78-AA8E-(E-Mail Removed)...
> Hi, Tom. Am using 2002; however, when I go to delete rows and select
> Edit/Delete, I get a message saying locked cells cannot be deleted when
> the
> sheet is protected...because the row I'm trying to delete has some locked
> cells. Even though when you go to protect you select the option to allow
> the
> user to delete rows, they can only delete a row if all the cells in that
> row
> are unlocked. Maybe code that says if the user selects 1 or more rows,
> then
> unlock all the cells in that row (to allow them to delete the row)....not
> exactly sure how to do this though. Am trying to play around with it now.
>
>
> "Tom Ogilvy" wrote:
>
>> If your using xl2002 or later, you should be able to specify as part of
>> the
>> protection options to allow the user to delete a row even on a protected
>> sheet.
>>
>> --
>> Regards,
>> Tom Ogilvy
>>
>>
>> "Paige" wrote:
>>
>> > Thanks; however, I understand that part. I had the code below, but it
>> > still
>> > doesn't allow the user to delete a row; it just unprotects/reprotects.
>> >
>> > Private Sub Worksheet_Change(ByVal Target As Range)
>> > If Target.Address = Target.EntireRow.Address Then
>> > ActiveSheet.Unprotect
>> > End If
>> > ActiveSheet.Protect
>> > End Sub
>> >
>> > "Brotha Lee" wrote:
>> >
>> > >
>> > > Activesheet.unprotect and protect will do the trick. You can also try
>> > > the
>> > > macro recorder, which will show you the exact syntax
>> > >
>> > > "Paige" wrote:
>> > >
>> > > > I need worksheet code that specifies if a user selects 1 or more
>> > > > rows to
>> > > > delete, it will unprotected the sheet and allow the deletion, then
>> > > > re-protect
>> > > > the sheet when the deletion is done. In a post from February 2006,
>> > > > a
>> > > > gentleman by the name of Turboj indicated he had posted code for
>> > > > this, but I
>> > > > can't find it anywhere. Does someone know how to do this?