Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet protection prevents Data Validation code from running...

I followed a tutorial to add a small bit of code to allow new items to be
added and automatically sorted in validation drop-down lists. Here's the site
with the tutorial:
http://www.contextures.com/excel-dat...n-add.html#Top

The code allows users to add new items to a list if it isn't already present
in the data validation drop-down list. It then automatically sorts the list.
Well it works great with an uprotected worksheet, but after I apply
protection, the code won't run. I even tried checking all items in the sheet
protection dialog box to see if one of them would allow the code to run but
it still blocks it.

Any ideas how to allow the code to run with sheet protection? Might I use
Allow Users to Edit Ranges under Sheet Protection?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Worksheet protection prevents Data Validation code fromrunning...

Hi
Password protect the sheet with "mypassword" say.
Near the top of the worksheet_change code put
Activesheet.Unprotect password:="mypassword"

and at the end put
Activesheet.Protect password:="mypassword"

not tested, so may do something funny inside a change event, but you
could try it out.
regards
Paul

On May 6, 2:29*pm, CHall wrote:
I followed a tutorial to add a small bit of code to allow new items to be
added and automatically sorted in validation drop-down lists. Here's the site
with the tutorial:http://www.contextures.com/excel-dat...n-add.html#Top

The code allows users to add new items to a list if it isn't already present
in the data validation drop-down list. It then automatically sorts the list.
Well it works great with an uprotected worksheet, but after I apply
protection, the code won't run. I even tried checking all items in the sheet
protection dialog box to see if one of them would allow the code to run but
it still blocks it.

Any ideas how to allow the code to run with sheet protection? Might I use
Allow Users to Edit Ranges under Sheet Protection?


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
Worksheet protection interfering with data validation combo box pr Lele Excel Discussion (Misc queries) 1 March 4th 07 07:51 PM
Data Validation Protection LRodgers Excel Discussion (Misc queries) 2 May 24th 06 03:41 PM
Protection error when running VB code mrossman04 Excel Programming 2 February 9th 06 04:36 AM
Worksheet Change code not running when you just delete data in cells. KimberlyC Excel Programming 0 June 23rd 05 01:43 AM
Code Halt - prevents reset of the AutomationSecurity level Walt[_3_] Excel Programming 8 March 24th 05 06:55 PM


All times are GMT +1. The time now is 02:25 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"