View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Jac Jac is offline
external usenet poster
 
Posts: 58
Default AutoFilter can't work after the worksheet is being protected!!

Hi Steve,

Thanks for your help.......... : )
my problem has solved now!!!



"steve_doc" wrote:

Cause of the error is your worksheet protection afaik
especialy if you are trying to paste some data into protected sheet

Easy solution - programme your macro to unprotect the sheet
Perform rest of code
Then protect the worksheet again

HTH

"Jac" wrote:

Hi,

I've recorded a macro which would help me to filter for desired records in a
data list using MS Excel 2003. After that, I assigned the macro to a command
button. But I wish to locked the location of the button on the worksheet, top
(100), left (50). So I used Protect Sheet option to protect the sheet with
Use AutoFilter option being selected. Unfortunately, once I run the macro
after the sheet is protected; a debug will be generated, "Run-time error
1004"!!!

What would be the cause for the debug???
Anyone could help on this????

Thanking in advance.