PC Review


Reply
Thread Tools Rate Thread

1004 Cell Protected Error for data validation lists when locked and protected

 
 
chris_j_adams@hotmail.com
Guest
Posts: n/a
 
      6th Nov 2006
Hi,

With XL97 I'm wondering if it is possible to change the value of cells
with data validation lists when:
(i) those list validation cells are locked; and
(ii) the sheet is protected, with userInterfaceOnly:=True

I'd like to have a button to reset all these cells back to blank (ie.
the first item in the validation list). However, I get a 1004 error
("the cell is protected and therefore read only") when I try to do this
via VBA, like so:

Range("A1").MergeArea.Value = ""

There are quite a few validation cells, each looking at different
lists, and they are generally merged cells. Perhaps there's an
alternative way of setting the cell to the first item?

Thanks in advance if anyone can provide any help/suggestions.

Regards,
Chris Adams

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      6th Nov 2006
Unprotect the worksheet first, do your stuff, and protect it again
afterwards.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> With XL97 I'm wondering if it is possible to change the value of cells
> with data validation lists when:
> (i) those list validation cells are locked; and
> (ii) the sheet is protected, with userInterfaceOnly:=True
>
> I'd like to have a button to reset all these cells back to blank (ie.
> the first item in the validation list). However, I get a 1004 error
> ("the cell is protected and therefore read only") when I try to do this
> via VBA, like so:
>
> Range("A1").MergeArea.Value = ""
>
> There are quite a few validation cells, each looking at different
> lists, and they are generally merged cells. Perhaps there's an
> alternative way of setting the cell to the first item?
>
> Thanks in advance if anyone can provide any help/suggestions.
>
> Regards,
> Chris Adams
>



 
Reply With Quote
 
chris_j_adams@hotmail.com
Guest
Posts: n/a
 
      7th Nov 2006
Thanks Bob. I was hoping that was not the only solution, simply because
my code requires a loop and there is potential for error, which means I
have to put an error trap in that checks for the sheet protection in
case I get flipped out. I gues it has to be done.

Many thanks for your help, much appreciated.
Chris Adams

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protected Worksheet 1004 error while running macro to import data =?Utf-8?B?ZHRnX2RlbnZlcg==?= Microsoft Excel Crashes 1 12th Aug 2005 08:41 PM
List, Data Validation, unlocked cell, protected sheet..... =?Utf-8?B?S2FuZQ==?= Microsoft Excel New Users 5 8th Jan 2005 10:39 PM
Data Validation Lists in Protected Worksheet Erin Microsoft Excel Misc 1 15th Sep 2004 07:59 PM
Copying cell formatting and data validation in protected worksheet =?Utf-8?B?TWF0aGlhcw==?= Microsoft Excel Misc 1 26th Nov 2003 12:03 AM
Re: validation lists and protected work sheets Tom Ogilvy Microsoft Excel Programming 0 12th Sep 2003 01:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:13 PM.