Solved

Excel 2016 - AutoFilter on selected columns issue

Posted on 2016-10-19
5
61 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 50

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 50

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 50

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

726 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