M
mark
Hello.
I have a worksheet with an autofilter set. The AutoFilter has 69 columns in
it. I can obtain that number like this:
Dim flt As AutoFilter
Set flt = wsBOM.AutoFilter
MsgBox flt.Filters.count
What I want to know is if one of two specific columns are filtered to =TRUE
I can find that, if they are, by using:
MsgBox flt.Filters(Range(cnLTMFGCPOrChange).Column).Criteria1 .
If the filter is set, that returns "=TRUE"
But, if the filter is not set to anything, I get an error message box which
has the title Microsoft Visual Basic, has a red circle x on the left, and
says 400.
I tried putting On Error Resume Next before it, but it still gives me the
error message box.
Can someone help me with how to return or pass by in code when a filter is
not set? Basically, the normal condition is that one of two filters will be
set. I need to be able to trap which one it was, and hold that information
to re-apply it at the end.
Thanks.
Mark
I have a worksheet with an autofilter set. The AutoFilter has 69 columns in
it. I can obtain that number like this:
Dim flt As AutoFilter
Set flt = wsBOM.AutoFilter
MsgBox flt.Filters.count
What I want to know is if one of two specific columns are filtered to =TRUE
I can find that, if they are, by using:
MsgBox flt.Filters(Range(cnLTMFGCPOrChange).Column).Criteria1 .
If the filter is set, that returns "=TRUE"
But, if the filter is not set to anything, I get an error message box which
has the title Microsoft Visual Basic, has a red circle x on the left, and
says 400.
I tried putting On Error Resume Next before it, but it still gives me the
error message box.
Can someone help me with how to return or pass by in code when a filter is
not set? Basically, the normal condition is that one of two filters will be
set. I need to be able to trap which one it was, and hold that information
to re-apply it at the end.
Thanks.
Mark