Hi again,
I think I have figured out the problem, but I have no clue how to remedy it.
It has to do with the date format.
Here in the UK the standard date format is dd/mm/yyyy and all the worksheets will have the date formatted that way.
The macro you wrote is reading the date range entered by the user as mm/dd/yyyy and thus producing incorrect results.
To test this, I changed the dates in the worksheets back to between 01 January 2012 and 10 January 2012 and did a search range of 01/01/2012 and 03/01/2012.
This search range displayed every result, as it was searching from 01 January 2012 to 01 March 2012 and not 01 January to 03 January as I thought it was.
A search range of 01/01/2012 and 01/03/2012 worked correctly, only producing a few results.
So is there a way to force the macro to accept a dd/mm/yyyy format?
This is the format here in the UK and everyone entering dates or running searches will be entering dates in this format.
As a side issue, and out of curiosity, I changed the format of the date cells to dd/mmm/yyyy so that all the dates were shown in full (01 January 2012 to 10 January 2012)
I also changed the format of the destination cells on the weekly worksheet to match this.
When I did a search for 01/01/2012 to 03/01/2012 (January to March in US format) it produced all the results (as expected) but changed the dates in the destination cells.
So even though the date was displayed as 06 January 2012 on the worksheet, when copied into the weekly worksheet, it became 01 June 2012.
This change happened to every result, making them all incorrect, even though they were displayed correctly before being copied.
Attached is the very workbook I was just using. You should be able to replicate the results above and see the issues I am highlighting.
Once again, and probably not for the last time, I am expressing my eternal gratitude for your assistance on this matter.
I may end up buying you a crate of beer or something..
Thanks,
Ed
Bookmarks