Solved

Excel 2016 - AutoFilter on selected columns issue

Posted on 2016-10-19
5
74 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 51

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 51

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 51

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

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…
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

695 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