OK....It has just dawned on me what I THINK you mean. Do you want the data in the AUTO GENERATED sheet sorted after you have run the macro so that the earliest EX FACTORY date is in the left most column?
If so there are a couple of things you need;
1. Put this formula into cell D1 and drag across as far as you need
=IFERROR(MATCH(FALSE,ISBLANK(D3:D999),0),999)
You can hide this if you like by giving a custom format of 3 semi colons ;;;
2. Use this sort macro
see attached.
Please note that my original code assumes the styles are in the same order as in the INPUT DATA sheet, so once you have sorted it, that macro won't work with the sorted data.
That is why I asked you that question about the styles being in the same order on the two sheets.
If this is a problem (I'm not sure how you use this sheet, it may not be), then I will need to change the auto generate macro, which will be trickier because you are using merged cells for the styles in the INPUT DATA sheet. (Tsk Tsk)
Bookmarks