Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 1004 Cell Protected Error for data validation lists when locked and protected

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 1004 Cell Protected Error for data validation lists when locked and protected

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)

wrote in message
oups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 1004 Cell Protected Error for data validation lists when locked and protected

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
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
List, Data Validation, unlocked cell, protected sheet..... Kane New Users to Excel 6 July 16th 12 09:11 AM
Why am I able to type in a cell that is locked and protected? VikyTurner Excel Worksheet Functions 0 November 18th 05 08:51 PM
run time error 1004 on protected worksheet when I try to run macro dtg_denver Excel Programming 13 August 13th 05 01:23 AM
Error 1004 when running on a protected sheet jmj2366 Excel Programming 0 August 25th 04 05:32 PM
validation lists and protected work sheets Tom Ogilvy Excel Programming 0 September 12th 03 01:01 PM


All times are GMT +1. The time now is 06:15 AM.

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"