Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Event/Method for Unprotecting worksheet


I am trying to allow a user to insert a picture object onto a protected
worksheet in selected cells.

I assume the best method would be to unprotect the worksheet when the
user selects a particular cell and then reprotect it when the
leave....

I have put together the following code but don't have the correct
event/method as it is not firing off...

Any help would be greatly appreciated....




Private Sub Worksheet_Change(ByVal Target As Range)

On Error Resume Next
If ActiveCell.Range("C2:AL2", "C14:AL14", "C26:AL14").Select Then
ActiveSheet.Unprotect
Else: ActiveSheet.Protect True, True, True, True

End Sub


--
jpendegraft


------------------------------------------------------------------------
jpendegraft's Profile: http://www.excelforum.com/member.php...fo&userid=5701
View this thread: http://www.excelforum.com/showthread...hreadid=261753

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Event/Method for Unprotecting worksheet

Hi
try using the selection_change event for this

--
Regards
Frank Kabel
Frankfurt, Germany


jpendegraft wrote:
I am trying to allow a user to insert a picture object onto a
protected worksheet in selected cells.

I assume the best method would be to unprotect the worksheet when the
user selects a particular cell and then reprotect it when the
leave....

I have put together the following code but don't have the correct
event/method as it is not firing off...

Any help would be greatly appreciated....




Private Sub Worksheet_Change(ByVal Target As Range)

On Error Resume Next
If ActiveCell.Range("C2:AL2", "C14:AL14", "C26:AL14").Select Then
ActiveSheet.Unprotect
Else: ActiveSheet.Protect True, True, True, True

End Sub


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
Unprotecting a worksheet Jessica Excel Worksheet Functions 8 August 21st 08 06:43 PM
Unprotecting a Worksheet Anney Excel Worksheet Functions 7 August 4th 07 01:14 PM
unprotecting a worksheet Randy123 Excel Discussion (Misc queries) 1 August 8th 05 06:11 PM
Event Procedures: Event on Worksheet to fire Event on another Worksheet Kathryn Excel Programming 2 April 7th 04 07:35 PM
Help with unprotecting worksheet in Excel 97 Steve Mikula Excel Programming 1 November 3rd 03 08:02 PM


All times are GMT +1. The time now is 04:31 PM.

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"