View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ShaneDevenshire ShaneDevenshire is offline
external usenet poster
 
Posts: 2,344
Default search locked cells

Hi,

When you turn protection on by choosing Tools, Protection, Protect Worksheet
you can scoll the Allow list to check the option Use AutoFilter.

You can recorded it or just add it to your code.

If this helps, please click the Yes button.
--
Thanks,
Shane Devenshire


"Miree" wrote:

I have data some of which is locked, but need to be able to filter this
ideally i would like to do this without unlocking the cells is this possible?

At the moment I have the following code used to put filter option on or off,
but when i put it on it locks the cells so doesnt work how can i get it to
only lock if filter is off?

Sub Filter()
Sheets("samples").Select
Cells.Select
ActiveSheet.Unprotect Password
Range("A3:F3").Select
Selection.AutoFilter
Sheets("samples").Select
Cells.Select
ActiveSheet.Protect Password
End Sub

Thanks