Hello, let me start off by saying that I am relatively new to VBA and macros in excel. My problem is this, I have a list of suppliers and shipping information, and I need to calculate if their shipments are on time using one of these two macros I've made;
=IF(U2>14,"Early",IF(U2<-7,"Late","On-Time"))
=IF(U3>7,"Early",IF(U3<0, "Late", "On-Time"))
The first macro is for our international suppliers, they are allowed up to 14 days early and 7 days late to count as the shipment being on time, and for suppliers in the states it is 7 days early allowed and 0 days late. What I need to figure out in a macro or VBA is to have it searched the field that contains the supplier name, and if it returns being 1 of the 5 international suppliers (I would have a list of the 5 int. suppliers in the macro somewhere) it would use the first equation to calculate it being on time or not.
I have attached a sample spreadsheet below, the supplier names in column B are examples of either US suppliers (US1, US2 ect.) or INT1-INT5 for the international suppliers. The blank spacing in between all the columns will be filled in later with other information and can be ignored. The "Status" Column is the field that uses either one of the above macros, and it references the column "Days Early / Late (-)" which is calculated from the "Planned Delivery date"-"Receipt Date"(date we receive the shipment).
If anyone may have any ideas on how I can be able to do this I would be very thankful.
Bookmarks