+ Reply to Thread
Results 1 to 9 of 9

How to Filter fields

  1. #1
    Registered User
    Join Date
    06-15-2015
    Location
    Waltham, MA
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    How to Filter fields

    need some additional help to a thread I had posted yesterday, but different subject this time around.

    Yesterday, I needed help copying information from one workbook to another- which was solved.
    Now, I have a 3rd workbook. I first need to filter 2 fields before i can copy the information to the other workbook. I'm having trouble doing so. Here is what my code looks like right now, but the most I can get it to do is to turn on the filters, but I can't select the 2 columns I need to filter by and provide it the criteria.

    Please Login or Register  to view this content.
    Row 4 is the Header, would that be the issue?

    The second column I need Filtered is column V, but for that filter, I need it to exclude "New York". Is there a way to tell it 'does not equal' as opposed to providing it all of the acceptable cities and purposely leaving out New York?

    Thanks so much!
    E

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to Filter fields

    For Column V.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-15-2015
    Location
    Waltham, MA
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: How to Filter fields

    Could I essentially do the same for my need to filter by Boston in Column M?

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-15-2015
    Location
    Waltham, MA
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: How to Filter fields

    Also, this doesn't work. I inserted the above, exactly as written, and it tries to filter Column A to not equal "New York". Which, isn't even an option for Column A. Since I'm not pointing to it, I'm not sure why it's trying to go there.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to Filter fields

    Quote Originally Posted by EC37 View Post
    Could I essentially do the same for my need to filter by Boston in Column M?

    Please Login or Register  to view this content.
    Yes, but in that case you don't need the equal "=" sign.

    Can you provide a copy of a sample file in which the code doesn't work? If you use the code provided with the range provided as well, I don't know why it would try to filter on Column "A"??

  6. #6
    Registered User
    Join Date
    06-15-2015
    Location
    Waltham, MA
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: How to Filter fields

    Err. Unfortunately it's all confidential data. Boston and New York are actually irrelevant, just used to figure out how to write the code

    it would take some time to rebuild as dummy data. But, after you provided the info on how to write the filters, this is how the code looks?

    Please Login or Register  to view this content.
    I can't figure out why it would point to Column A.
    The other weird thing, is by inserting those 2 lines, it removes the AutoFilter I set for A4:BZ4- and instead only has filters on M & V.

    If I remove the line to filter on "Boston", it instead points to Column A. If I keep the code as is, above, it tries to filter Column M to not equal New York.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to Filter fields

    Try:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-15-2015
    Location
    Waltham, MA
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: How to Filter fields

    Successsss. You are the best! Thank you!

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to Filter fields

    You're welcome. Glad to help out and thanks for the feedback. Please compy with Forum rules and mark this thread as SOLVED. See Rules link for guidance.

    http://www.excelforum.com/forum-rule...rum-rules.html

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. using two fields in a filter - VBA
    By easty in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2010, 11:41 AM
  2. [SOLVED] Return unique fields only - but not a filter?
    By Matt in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  3. Return unique fields only - but not a filter?
    By Harlan Grove in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 05:05 PM
  4. Return unique fields only - but not a filter?
    By Matt in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  5. Return unique fields only - but not a filter?
    By Matt in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  6. [SOLVED] Return unique fields only - but not a filter?
    By Matt in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  7. Return unique fields only - but not a filter?
    By Matt in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  8. [SOLVED] Return unique fields only - but not a filter?
    By Matt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-17-2005, 08:05 PM

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