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

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.