![]() |
How to turn Autofilter off with VBA
Using VBA i want to make sure Autofilter is off before I run some other code.
I ran macro recorder and see that the command Autofilter toggles the autofilter on and off. The problem is I just want to turn it off, so i can't use this command if the autofilter is not on or it turns it on. Is there some resource online or within help that describes the macro commands and which qualifiers you can use with them (I tried "Autofilter off" and "Autofilter False", but it gives me errors). Can anyone tell me how to use this command to switch autofilter off. Thanks Dave PS - sorry for the double post (also in general questions) |
How to turn Autofilter off with VBA
Hi Dave,
John hasn't replied so he must be busy or away. In Project 2003 the following works for me: ActiveProject.AutoFilter = false ActiveProject.AutoFilter = true Otherwise try: Sub AutoFilterOn() If ActiveProject.AutoFilter = False Then Application.AutoFilter End If End Sub Sub AutoFilterOff() If ActiveProject.AutoFilter = True Then Application.AutoFilter End If End Sub -- Rod Gill Project MVP Visit http://www.msproject-systems.com for Project Companion Tools and more |