Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel 2016 - AutoFilter on selected columns issue

Posted on 2016-10-19
5
Medium Priority
?
95 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 53

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 53

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 53

Accepted Solution

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

line 6 instead of 5
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

609 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