+ Reply to Thread
Results 1 to 3 of 3

Excel table filter by date variable through data picker date variable

  1. #1
    Registered User
    Join Date
    08-24-2018
    Location
    Sri Lanka
    MS-Off Ver
    2016 MSO 32 it
    Posts
    2

    Angry Excel table filter by date variable through data picker date variable

    Hi, All
    I'm tried to filter excel table by date variables through data picker. table filter with no entries by the program. buy actually table has values within the selected range. My code as below, pls help.


    ++++++++++++++++++++++++++++++
    Sub Filter_table()




    Dim from_date As Date
    Dim to_date As Date
    'Dim my_range As Range
    Dim Table1 As ListObject

    from_date = DTPicker1
    to_date = DTPicker2


    Set Table1 = Sheet2.ListObjects(1)


    Set my_range = Selection


    Table1.Range.AutoFilter 5, ">=" & from_date, xlAnd, "<=" & to_date



    End Sub

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Excel table filter by date variable through data picker date variable

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)


    To help to debug please attach an excel sample
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    08-24-2018
    Location
    Sri Lanka
    MS-Off Ver
    2016 MSO 32 it
    Posts
    2

    Re: Excel table filter by date variable through data picker date variable

    Pls refer below codes.


    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)

Similar Threads

  1. Using a date picker to filter a pivot table on another sheet
    By dcdeez in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-13-2020, 06:13 AM
  2. Setting date picker date and having 2 columns to each date for excel calendar
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2017, 11:13 PM
  3. [SOLVED] Excel - VBA : pass variable from Sub to Userform (Date Picker) Part II
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-27-2017, 01:31 PM
  4. [SOLVED] Excel - VBA : pass variable from Sub to Userform (Date Picker)
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-27-2017, 02:23 AM
  5. VBA Define Date Variable as Filter Criteria
    By KostasK8 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2014, 03:50 PM
  6. Replies: 1
    Last Post: 10-27-2012, 02:54 AM
  7. Pivot Table - variable date
    By Picto in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-14-2007, 10:03 AM

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