+ Reply to Thread
Results 1 to 9 of 9

Filter data in another sheet

  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Filter data in another sheet

    I'm trying to filter data in Sheet1 with values in Sheet2 when clicking a button, I've tried looking for a macro that am getting an error "AutoFilter method of Range class failed"

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Filter data in another sheet

    Try this one

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Filter data in another sheet

    Same error, the following line is highlighted in the debugger

    error2.png

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,612

    Re: Filter data in another sheet

    Because you are Filtering Selection. , Pl chech up Selection range.Cursor should be in Database range.

  5. #5
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Filter data in another sheet

    Thank you for your reply however I am new to VB and do not understand your answer

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Filter data in another sheet

    Allan,
    I think it would be much easier if you could attach your sample, so that we can see and test where the error is.

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,612

    Re: Filter data in another sheet

    While running the macro the curser in worksheet should be within database range.
    Eg: Filter range is A1:E25 cursor may be in D13.

  8. #8
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Filter data in another sheet

    The was the problem, simple things! I'm trying to then export the newly filtered data to a graph in a new sheet, can it be done on the same macro?

  9. #9
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Filter data in another sheet

    Also, is there any way to select more than 1 column filter? i.e. the below code is taking a year value from F17, such as 2006, can it take additional inputs to filter by say 2006, 2007, 2008?

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1