+ Reply to Thread
Results 1 to 3 of 3

Help on date input with Inputbox

  1. #1
    Registered User
    Join Date
    09-02-2011
    Location
    NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Help on date input with Inputbox

    Hi all,

    I was writing code to filter & copy/paste contents based on certain criteria. One of the criteria was the date in a column is equal to or earlier than the date input in the inputbox. But I couldn't get it work. - no content was copied except for header row.

    The inputbox line I used was
    ThresholdDate = InputBox("Enter the threshold Date in MM/DD/YYYY format")

    The Autofilter line was:
    Selection.Autofilter Field:=14, Criteria1:="<=ThresholdDate".

    I believe other part of the code is OK because if I use a fixed date instead of "ThresholdDate", such as 12/31/2010, it copies the right content.

    Thanks in advance for any help!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Help on date input with Inputbox

    miaozi,

    Welcome to the forum. In the future, please wrap code in code tags. As for your question:

    Instead of:
    Please Login or Register  to view this content.

    Use this:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Registered User
    Join Date
    09-02-2011
    Location
    NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help on date input with Inputbox

    Hi Tigeravatar,

    It did. Thanks for the quick reply!
    Will read the FAQ/Forum rules more closely before future postings


    Quote Originally Posted by tigeravatar View Post
    miaozi,

    Welcome to the forum. In the future, please wrap code in code tags. As for your question:

    Instead of:
    Please Login or Register  to view this content.

    Use this:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

+ 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