ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autofilter on hidden sheet (https://www.excelbanter.com/excel-programming/426407-autofilter-hidden-sheet.html)

JLR-Mart

Autofilter on hidden sheet
 
Does anyone know if it is possible to use autofilter on a hidden worksheet. I
know that as a workaround I can make it visible, do the do, and then make it
hidden again, but out of curiosity I wondered whether this is some sort of
restriction??

We've tried several methods without any success.

Any help greatly appreciated

Nigel[_2_]

Autofilter on hidden sheet
 
You can filter on a hidden sheet but not a protected one unless you allow
filtering. What methods have you tried?

--

Regards,
Nigel




"JLR-Mart" wrote in message
...
Does anyone know if it is possible to use autofilter on a hidden
worksheet. I
know that as a workaround I can make it visible, do the do, and then make
it
hidden again, but out of curiosity I wondered whether this is some sort of
restriction??

We've tried several methods without any success.

Any help greatly appreciated



JLR-Mart

Autofilter on hidden sheet
 
Our code looks something like this:

Worksheets("BPNO_CPSCII").Activate
Range("A1:G1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<*" & CPSC & "*"

BUT when it runs it filters the currently visible sheet and NOT the hidden
one (BPNO_CPSCII) as required

"Nigel" wrote:

You can filter on a hidden sheet but not a protected one unless you allow
filtering. What methods have you tried?

--

Regards,
Nigel




"JLR-Mart" wrote in message
...
Does anyone know if it is possible to use autofilter on a hidden
worksheet. I
know that as a workaround I can make it visible, do the do, and then make
it
hidden again, but out of curiosity I wondered whether this is some sort of
restriction??

We've tried several methods without any success.

Any help greatly appreciated




Nigel[_2_]

Autofilter on hidden sheet
 
Yes but you cannot activate a hidden sheet.

Change your code to

With Worksheets("BPNO_CPSCII").Range("A1:G1")
.AutoFilter
.AutoFilter Field:=1, Criteria1:="<*" & CPSC & "*"
End With


In general you never need to select before acting on a worksheet or its
objects.

--

Regards,
Nigel




"JLR-Mart" wrote in message
...
Our code looks something like this:

Worksheets("BPNO_CPSCII").Activate
Range("A1:G1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<*" & CPSC & "*"

BUT when it runs it filters the currently visible sheet and NOT the hidden
one (BPNO_CPSCII) as required

"Nigel" wrote:

You can filter on a hidden sheet but not a protected one unless you allow
filtering. What methods have you tried?

--

Regards,
Nigel




"JLR-Mart" wrote in message
...
Does anyone know if it is possible to use autofilter on a hidden
worksheet. I
know that as a workaround I can make it visible, do the do, and then
make
it
hidden again, but out of curiosity I wondered whether this is some sort
of
restriction??

We've tried several methods without any success.

Any help greatly appreciated





Dave Peterson

Autofilter on hidden sheet
 
You can't activate a hidden sheet. But the good thing is that you don't need
to.

with Worksheets("BPNO_CPSCII")
.autofiltermode = false 'remove any existing filter.
.Range("A1:G1").AutoFilter Field:=1, Criteria1:="<*" & CPSC & "*"
end with

JLR-Mart wrote:

Our code looks something like this:

Worksheets("BPNO_CPSCII").Activate
Range("A1:G1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<*" & CPSC & "*"

BUT when it runs it filters the currently visible sheet and NOT the hidden
one (BPNO_CPSCII) as required

"Nigel" wrote:

You can filter on a hidden sheet but not a protected one unless you allow
filtering. What methods have you tried?

--

Regards,
Nigel




"JLR-Mart" wrote in message
...
Does anyone know if it is possible to use autofilter on a hidden
worksheet. I
know that as a workaround I can make it visible, do the do, and then make
it
hidden again, but out of curiosity I wondered whether this is some sort of
restriction??

We've tried several methods without any success.

Any help greatly appreciated




--

Dave Peterson


All times are GMT +1. The time now is 09:10 PM.

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