+ Reply to Thread
Results 1 to 2 of 2

Button to search and filter all dates between two dates

  1. #1
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Slough
    MS-Off Ver
    Excel 2007
    Posts
    469

    Button to search and filter all dates between two dates

    I have a list of 100 dates and would like to write a macro that allows you to type in 2 dates and click a button to filter all dates between the two I have input.

    I hope that is clear enough .

    Thanks in advance

    Danny

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Button to search and filter all dates between two dates

    Hi, Danny ,

    both the Autofilter as well as the Advanced Filter feature what you want (without the use of VBA) -why do you need a macro?

    And if so: make all cells visible, get the last row, loop from start to end and compare if the date is greater or equal to cell-value Start and less that or equal cell-value end. If so, use something like
    Please Login or Register  to view this content.
    where lngCounter is the Row counter inside your loop.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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