+ Reply to Thread
Results 1 to 4 of 4

Filtering List by Values Using Simple Arithmetic

  1. #1
    Registered User
    Join Date
    05-31-2020
    Location
    Tokyo
    MS-Off Ver
    Microsoft Office 365
    Posts
    11

    Question Filtering List by Values Using Simple Arithmetic

    Hi Everyone,

    First off, I am new to this forum so I would like to say hello and thank all in advance for this active community.

    I am a novice coder so apologies in advance if my questions are very basic.

    The below code is my attempt to filter a list based on Month and Year.
    Field 2 is Months column and it filters as intended, based on a dropdown list in Range "B7".

    Field 1 is where I continuously keep running into problems.
    My intention is to filter the list, showing only data from the most recent 3 years based on Range "B6".

    I have confirmed the array is populating accurately with the intended years, however the list is not being filtered properly.
    The list disappears suggesting it is filtering by invalid data.

    What am I missing here?

    Thank you


    Please Login or Register  to view this content.
    Last edited by rastawolf; 06-01-2020 at 09:03 AM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Filtering List by Values Using Simple Arithmetic

    Hi,

    Range.AutoFilter requires that the criteria be text.

    You could define YearFilter as:

    Please Login or Register  to view this content.
    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    05-31-2020
    Location
    Tokyo
    MS-Off Ver
    Microsoft Office 365
    Posts
    11

    Re: Filtering List by Values Using Simple Arithmetic

    Thank you, I had a hunch this was a datatype issue, and I didn't know the built in function CStr. This will prove to be very useful going forward!

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Filtering List by Values Using Simple Arithmetic

    You're welcome!

    Regards

+ 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. [SOLVED] VLookup or Index/Match WITH Simple Arithmetic...
    By Ourkid123uk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-12-2017, 10:50 AM
  2. VBA to display simple arithmetic in a cell
    By Centexcel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-21-2013, 09:55 AM
  3. [SOLVED] How can I create a chart/list using modular arithmetic?
    By enimagnetic in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2013, 04:30 PM
  4. Calculate the arithmetic mean of filtered list of values
    By jackehendrix in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-13-2012, 01:42 PM
  5. How to display the arithmetic mean of all the values in a bar chart?
    By sarahsez in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-06-2012, 08:16 PM
  6. [SOLVED] Simple arithmetic
    By Pat in forum Excel General
    Replies: 5
    Last Post: 01-24-2005, 05:17 PM
  7. [SOLVED] Simple arithmetic - take 2
    By Pat in forum Excel General
    Replies: 1
    Last Post: 01-24-2005, 05:06 PM

Tags for this Thread

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