Mombu the Microsoft Forum

Mombu the Microsoft Forum (http://www.mombu.com/microsoft/index.php)
-   Microsoft Project Developer (http://www.mombu.com/microsofthttp://www.mombu.com/microsoft/f-microsoft-project-developer-298/)
-   -   How to turn Autofilter off with VBA (http://www.mombu.com/microsofthttp://www.mombu.com/microsoft/microsoft-project-developer/t-how-to-turn-autofilter-off-with-vba-303470-print.html/)

dave 31st July 13:36

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)

rod gill rod at project-systems dot co dot nz 31st July 13:37

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


td class="smallfont">All times are GMT -3. The time now is 13:21.