Hello,
I'm pulling rows of data from a data worksheet where column 'B' contains random dates. All dates fall on the same day of the week. New worksheets are created for every new date encountered from column 'B' and the worksheet is given the name of the date in the format "d-mmm-yy", for example 1-Dec-13. The appropriate row is cut from the the data worksheet and pasted in the worksheet with the same date.
This all works well but I have a sorting issue. I found the following worksheet sorting VBA code from Microsoft's site:
Things work well except the date format I'm working with does not sort properly. For example if worksheets are named '1-Dec-13', '8-Dec-13', '15-Dec-13', it sorts in the order of the initial digits without respecting the actual date.
In this case the sort order result would be '1-Dec-13', '15-Dec-13', '8-Dec-13'.
I put in some more random dates to see how it behaves and this is the sort order result:
1-Dec-13, 15-Dec-13, 16-Apr-13, 3-Apr-13, 6-Jun-13, 8-Dec-13
So is it handing these names as strings not dates since the month order is being messed up too? However the date variable has been declared as 'Date' and trying to force the specified format.
The option of changing the date format is not available.
Here is my code:
Thank you,
TV
Bookmarks