Solved

Excel 2016 - AutoFilter on selected columns issue

Posted on 2016-10-19
5
30 Views
Last Modified: 2016-10-19
When I do this I should get AutoFilters on columns 1 and 3. But I get 2 and 4 (see image).
Tried to fudge it with Field:=0 I get an error.

The odd behaviour that I get
According to here it should work.

Sub AutoFilterDropdownsON()

    With Range("E6:I6")
        .AutoFilter Field:=1, visibledropdown:=True
        .AutoFilter Field:=2, visibledropdown:=False
        .AutoFilter Field:=3, visibledropdown:=True
        .AutoFilter Field:=4, visibledropdown:=False
    End With

End Sub

Open in new window


Thanks for any ideas on this.
0
Comment
Question by:hindersaliva
  • 3
  • 2
5 Comments
 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 41849880
Hi,

Could you send a dummy?
Cannot reproduce error

Regards
0
 

Author Comment

by:hindersaliva
ID: 41849900
0
 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 41849918
Hi,

pls try
Sub AutoFilterDropdownsON()

    With Range("E5:I5")
        .AutoFilter
        .AutoFilter Field:=1, visibledropdown:=True
        .AutoFilter Field:=2, visibledropdown:=False
        .AutoFilter Field:=3, visibledropdown:=True
        .AutoFilter Field:=4, visibledropdown:=False
        .AutoFilter Field:=5, visibledropdown:=True
    End With

End Sub

Sub AutoFilterDropdownsOFF()

    With Range("E5:I5")
'        .AutoFilter Field:=0, VisibleDropDown:=True
        .AutoFilter Field:=1, visibledropdown:=False
        .AutoFilter Field:=2, visibledropdown:=False
        .AutoFilter Field:=3, visibledropdown:=False
        .AutoFilter Field:=4, visibledropdown:=False
        .AutoFilter Field:=5, visibledropdown:=False
    End With

End Sub

Open in new window

REgards
0
 

Author Comment

by:hindersaliva
ID: 41850085
Rgonzo, nope!
Error
0
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41850090
You range is not the same as in the file

line 6 instead of 5
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
This article will show you how to use shortcut menus in the Access run-time environment.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now