Hey all, newbie at Excel Macros here. I've looked around on the internet and can't seem to find a solution, so I'll post it here and hopefully get some answers.
I am an inventory associate at a wholesale shirt store, and I want to use macros to automatically sort rows of shirt info so I can check if we have it in stock or not.
Attached is a 20 row sample of shirts with some information.
Column A shows the status of the shirt (N for new, P for preorder, C for check if it is available, D for discontinued, and I for in-stock which is the default normal value).
Column B shows the date that either the Preorder shirts should arrive by, or the date that the New shirt was posted.
Column C is the name of the shirt, referred to as Style #.
Columns D through G are for seeing if the designs (called transfers) and/or the shirts with the designs are uploaded to the website. These can also be ignored for sorting.
The data is in the range of A2:G20.
What I would like to do with macros is the following:
- Automatically sort the rows so that items with status C are moved to the top (row 2), followed by status P, followed by status N, followed by statuses I and D, which don't need to be sorted.
- Automatically change P to C when the date in Column B passes today's date (in cell J3), which is 4/26/2021. I would set the formula to =TODAY() but I need the correct date for examples in the table.
- Automatically change N to I and remove the date from Column B when this date is 30 days past today's date. An example would be Row 19, which was New 30 days ago from today (4/26).
- Automatically alphabetically sort each section of rows using the names. The sections are based on the statuses: P, C, N, and D/I (which are mixed together). Within each section, sort the rows alphabetically using Column C.
It is important that these things be automatic (or at least at the push of a button like F5 or something) because our stock has 2000+ items.
Obviously any code I can copy and paste would be extremely helpful, but any sort of guidance or advice I can get would also be very appreciated!
Bookmarks