ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   search locked cells (https://www.excelbanter.com/excel-programming/419821-search-locked-cells.html)

Miree

search locked cells
 
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

ShaneDevenshire

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


Miree

search locked cells
 
Now I feel silly it was that simple!
Thanks

"ShaneDevenshire" wrote:

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



All times are GMT +1. The time now is 11:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com