Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Help: Unprotect Sheet Re-Protect Permitting 1 row Deletion

This might be a duplicate post but not sure anyone will see my other one
which is in a reply.

I'm trying to allow users of a protected sheet to delete a duplicate row.
When protection was applied thru the menu, "Allow User To Delete Row" was
checked.
Problem: when this code runs and I right click the pink dup row number,
"Delete" is not enabled. Please help!

If whichsheet = "ResData" Then
ThisWorkbook.Sheets("ResData").Unprotect ("myPw")
Intersect(Range("resRecNum"), rw).Interior.ColorIndex = 7
'pink

rw.Locked = False

Intersect(Range("resRecNum"), rw).Offset(-1,
0).Interior.ColorIndex = 50 'green
Intersect(Range("resMeasure"), rw) = "DUP"

'rw.Offset(-1).Locked = False

ThisWorkbook.Sheets("ResData").Protect ("MyPw"),
AllowDeletingRows:=True

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Help: Unprotect Sheet Re-Protect Permitting 1 row Deletion

This is what I guessed in the other post.

Is rw a row in a range--less than all the columns?

maybe

rw.entirerow.locked = false

Perico wrote:

This might be a duplicate post but not sure anyone will see my other one
which is in a reply.

I'm trying to allow users of a protected sheet to delete a duplicate row.
When protection was applied thru the menu, "Allow User To Delete Row" was
checked.
Problem: when this code runs and I right click the pink dup row number,
"Delete" is not enabled. Please help!

If whichsheet = "ResData" Then
ThisWorkbook.Sheets("ResData").Unprotect ("myPw")
Intersect(Range("resRecNum"), rw).Interior.ColorIndex = 7
'pink

rw.Locked = False

Intersect(Range("resRecNum"), rw).Offset(-1,
0).Interior.ColorIndex = 50 'green
Intersect(Range("resMeasure"), rw) = "DUP"

'rw.Offset(-1).Locked = False

ThisWorkbook.Sheets("ResData").Protect ("MyPw"),
AllowDeletingRows:=True


--

Dave Peterson
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
protect unprotect sheet vba ian bartlett Excel Programming 3 June 14th 07 04:15 AM
Unprotect and Protect sheet within macro John F[_2_] Excel Programming 3 January 11th 05 04:49 PM
Excel VBA-Protect and unprotect sheet with BVA marfrk Excel Programming 1 May 3rd 04 12:37 PM
Protect/unprotect sheet with password with VBA? dragontale[_7_] Excel Programming 1 April 19th 04 09:29 PM
VBA code - protect and unprotect a sheet Jeff Excel Programming 2 December 2nd 03 11:44 PM


All times are GMT +1. The time now is 05:51 AM.

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

About Us

"It's about Microsoft Excel"