Hi everyone,
Hope all's well.
For the attached file, i need a macro which can perform the below steps one after another.
1. Column I in sheets "Batches" is not considered as date due to ".". The same is to be changed to "-"
2. Column K in sheets "Batches" is to be fetched from sheet "Locations" using VLOOKUP. Formula entered in cell K4.
3. Column K in sheet "Batches" need to be replaced as per the tables "Site" and "CMO" in sheet "Pack Owner". If value in column K matches with columns A and D in sheet "Pack Owner", then the same should be replaced by values in columns B and E respectively. In short, i want the values in column K in sheet "Batches" should exactly match with the values in column U of sheet "Closed"
4. Column J in sheet "Batches" need to be fetched from sheet "Pack Owner". In case the value in column K in sheet "Batches" falls under column B of sheet "Pack Owner", then column J should populate Site. If it falls under Column E of sheet "Pack Owner", then CMO is to be populated.
Note: Sheets "Locations" and "Pack Owner" will always be hidden and locked with pass Abc@123.
Can someone please help ?
Detailed info as below, if required.
Lemme give a detailed explanation.
The data in sheet "Batches" will be pasted by downloading from an external source. The raw data will contain only the columns A to I.
Now I need to compare data in sheets "Batches" and "Closed" based on below 2 common criteria
Site and
Month
i.e.
1. Column K in sheet "Batches" and column U in sheet "Closed"
and
2. Column M in sheet "Batches" and column Q in sheet "Closed"
Hence i created additional columns in sheet "Batches" i.e. columns J to M.
Now to fulfill the first criteria, i need site name. This is fetched into column K from sheet "Locations" based on column H. However, the values will not exactly match and so there couldn't be a comparison between the 2 sheets. Hence, there's a need to duplicate the names and so i created 2 tables in sheet "Pack Owner".
The columns A and D in this sheet contains names from column B in sheet Locations and columns B and E in this sheet contains names as they are in column U of sheet "Closed". This will align the names in both sheets so that i can compare the data.
This completes the points 3 and 4 in my 1st post.
Last point 4 is to populate column J to know whether the value in column K is a Site or CMO. This can be identified from the columns B and E in sheet "Pack Owner". All the ones under column B are Site while under column E are CMO.
Bookmarks