PDA

View Full Version : Concatenate with conditional and reference



MrBear24
09-14-2021, 07:55 PM
Hello, this is what I need to complete for a soonTM project that I will be involved.

Explanation: I have 2 sheets: Matrix and Info. First, I need to check what number of Matrix I am going to use. For this, I go to sheet "Info" and for this example I will need to use the Matrix 40 (Note that it will not always be #40, sometimes I will need to use #20, #30 or #50, that cell "I2" will always specified me which matrix i will use. Also, in the near future there might be additional number of Matrix)

https://ibb.co/xDCZ5Hg

Now that I know which matrix I'm using, I go to sheet "Matrix" and check the range of cells I will need to use for the matrix. Since #40 is the matrix I need to use to complete this example, those are the attributes that I need to concatenate. The information for those attributes are in the sheet "Info". (check last link)

https://ibb.co/7nbxctV

I need to create a macro VBA that can concatenate those attributes from sheet "Matrix" to its corresponding information in sheet "Info" in the same order specified by column "B", but if there is information like "Not specified" or "Missing info", then you skip the concatenate for that attribute. The concatenation must follow this order: 1-Attribute#1=Value#1, 2-Attribute#2="Value#2", ...

So, for first product the right answer would be: 1-Brand="Casio", 2-Size="M", 3-Colour="Blue", 4-Type="A", 5-Origin="Finland". Attribute Recommendation will not be involved here since it is"Not specified".

Since for this exercise I have 5 products, the concatenation must be in Column "I" (Note: Sometimes, we will work with 1000 products or more, but the concatenation will always be in column "I").

https://ibb.co/J3wYRDZ

Thank you in advance for all the helpful responses.

Paul_Hossler
09-14-2021, 10:15 PM
An image on another hosting site is not very helpful

Attach a small sample workbook with sample data to your post here

See my sig for instructions

MrBear24
09-15-2021, 05:42 AM
Ok, im uploading the xcel file. Hope this can helps.