Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excell VBA

Status
Not open for further replies.

blazblaz

Technical User
Feb 3, 2002
71
0
0
CA
In VBA programming one of the rows I do filtering instruction

1) With Columns("M:M")
.AutoFilter Field:=1, Criteria1:="<>0", Operator:=xlAnd
End With


One of the possibility later is to undo the filtering, so I do the instruction

2. ActiveSheet.ShowAllData

If I do the instruction (2) second time, it will give the error.
I want to give the command :

DO undo filtering with “ActiveSheet.ShowAllData” just in case IF the filtering is ON.
What is the syntax for this?

Can anybody help me?

Thanks
 
Hi Blaz,

From Help:

If Worksheets("Sheet1").FilterMode = True Then
MsgBox "Filter mode is on"
ActiveSheet.ShowAllData
Else
MsgBox "Filter mode is off"
End If

Ilse
 
Also - please post in the correct forum. This is MSOffice NOT VBA. There is a specific VBA forum for VBA questions. Please use it

Rgds, Geoff

"Having been erased. the document thjat you are seeking. Must now be retyped"

Please read FAQ222-2244 before you ask a question
 
Thanks Ilses, your helped to solve my problem. Also XLBO, thank you for your info, I did not know that, in the future i will try to use right VBA forum for my VBO questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top