+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Use Textbox.Value in AutoFilter Criteria (autofilter date)

  1. #1
    Registered User
    Join Date
    07-03-2012
    Location
    KL, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Use Textbox.Value in AutoFilter Criteria (autofilter date)

    Hello,

    I have the following code generated by autofiltering on a list of date using a text filter "Contains" and then the typed date from , "7/1/2012" and date to "7/3/2012"

    Please Login or Register  to view this content.
    I would like a search button in my UserForm to activate this code when clicked. The difference is, in place of "date from" and "date to" I would like to have date types in TextBox1 and TextBox2, which would be in the same UserForm as the search button. The following was my attempt at the search button's code:

    Please Login or Register  to view this content.

    When clicked, I get no errors, and it filters my data, but it doesn't work correctly; all of the rows get filtered out, which must mean that whatever my code's autofilter criteria resolves to, it's not in the column of date. Any ideas on how to write this criteria so that my textbox's value will get used in the filter and how to change the textbox value as date?

  2. #2
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,162

    Re: Use Textbox.Value in AutoFilter Criteria (autofilter date)

    Please attach the sample file which you are using with your code.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-03-2012
    Location
    KL, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Use Textbox.Value in AutoFilter Criteria (autofilter date)

    Dear Arlette,

    Here I attached the sample of it

    Thank so much
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-03-2012
    Location
    KL, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Use Textbox.Value in AutoFilter Criteria (autofilter date)

    Dear Arlette,

    Kindly please refer the attachment below. I've already attach the correct sample file because there are some mistake in sample file (Book1-PC.xlsm) before this.

    Hope u can help me to solve this problem. Thanks
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-15-2013
    Location
    Luton
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Excel 2007 : Use Textbox.Value in AutoFilter Criteria (autofilter date)

    I am trying to do something very similar and look forward to the reply to the thread

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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