Hi! I have a workbook with an autofilter macro code on it. But whenever I protect it, the code would not work.
Is there a way to protect a cell at the same time use the auto filter macro?
Thanks!
Hi! I have a workbook with an autofilter macro code on it. But whenever I protect it, the code would not work.
Is there a way to protect a cell at the same time use the auto filter macro?
Thanks!
Last edited by geng; 09-05-2010 at 10:09 PM.
Either when the workbook opens or when the macro runs, reapply the "protection" adding the UserInterfaceOnly flag. Once that is turned on, the sheet is protected from humans, but VBA is free to function on it as if it were not protected. Very convenient.
![]()
Please Login or Register to view this content.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Hello,
in your code, you can unprotect the worksheet, run the filter code and then re-protect the worksheet.
![]()
Please Login or Register to view this content.
This is my autofilter code.
How do i apply the code that you gave on this code?
Thanks!![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks