Remove duplicate words

giannip

New Member
Joined
Sep 29, 2024
Messages
5
Office Version
  1. 365
Hi everyone,
I am having an issue with removing duplicating words. I have a bunch of data I need combined separated by commas. Example : High Fructose Corn Syrup, corn starch, water, sugar, corn starch, palm oil, salt, yeast, Palm oil, sugarcane, bleached sugar. Desired outcome: High Fructose Corn Syrup, corn starch, water, sugar, palm oil, salt, yeast, sugarcane, bleached sugar.
CONDITIONS: if column I (Supplier) is "Own Brand" then concatenate and remove duplicate values in R(allergens), S(Yes or No), T(ingredients), U(shared facilities) respectively, ONLY if values in column C match. Paste new concatenated string values into R, S, T, U, for Own brand rows in column I.

I do not want a function, I would like a VBA code that I can use in a Macro please. Any help would be deeply appreciated as I am extremely new to this. Baby steps please as I have been using Chatgbt to generate code and it does not provide the exact solution I need.
1728925415451.png
 
Id Keyallergens BE item Ingredient Statement
27milk, egg, wheat, soyYes Sugar, Water, Bleached Enriched Flour (Wheat Flour, Niacin, Reduced Iron, Thiamine Mononitrate, Riboflavin, Folic Acid), Vegetable Oil (Soybean Oil And/Or Palm Oil And/Or Canola Oil), Cocoa (Processed With Alkali), Dried Whole Eggs, Vegetable Shortening (Palm Oil, Soybean Oil, Propylene Glycol Mono- And Diesters Of Fats And Fatty Acids, Mono- And Diglycerides, Soy Lecithin). Contains 2% Or Less Of Each Of The Following: Soy Lecithin, Nonfat Dry Milk, Modified Food Starch (Corn), Sodium Bicarbonate, Dried Egg Whites, Wheat Starch, Salt, Sodium Aluminum Phosphate, Mono- And Diglycerides, Emulsifier (Propylene Glycol Mono- And Diesters Of Fats And Fatty Acids, Mono- And Diglycerides, Soy Lecithin), Sodium Acid Pyrophosphate, Polysorbate 60, Artificial Flavor, Sodium Stearoyl Lactylate, Guar Gum, Monocalcium Phosphate, Xanthan Gum, Soy Flour.
27soyYesSugar, Vegetable Shortening (Palm Oil, Canola Oil, Mono- And Diglycerides, Polysorbate 60), Water, Cocoa (Processed With Alkali). Contains 2% Or Less Of Each Of The Following: High Fructose Corn Syrup, Corn Syrup, Soybean Oil, Corn Starch, Salt, Natural And Artificial Flavor, Phosphoric Acid, Guar Gum, Potassium Sorbate (Preservative), Sodium Benzoate (Preservative).
29milk, egg, wheat, soyYesSugar, Water, Bleached Enriched Flour (Wheat Flour, Niacin, Reduced Iron, Thiamine Mononitrate, Riboflavin, Folic Acid), Vegetable Oil (Soybean Oil And/Or Palm Oil And/Or Canola Oil), Cocoa (Processed With Alkali), Dried Whole Eggs, Vegetable Shortening (Palm Oil, Soybean Oil, Propylene Glycol Mono- And Diesters Of Fats And Fatty Acids, Mono- And Diglycerides, Soy Lecithin). Contains 2% Or Less Of Each Of The Following: Nonfat Dry Milk, Modified Food Starch (Corn), Sodium Bicarbonate, Soy Lecithin, Dried Egg Whites, Wheat Starch, Salt, Sodium Aluminum Phosphate, Mono- And Diglycerides, Emulsifier (Propylene Glycol Mono- And Diesters Of Fats And Fatty Acids, Mono- And Diglycerides, Soy Lecithin), Sodium Acid Pyrophosphate, Polysorbate 60, Artificial Flavor, Sodium Stearoyl Lactylate, Guar Gum, Monocalcium Phosphate, Xanthan Gum, Soy Flour. Nutritional Information
29Milk, Wheat, Soy, CoconutYes High Fructose Corn Syrup, Hydrogenated Vegetable Oil (Palm, Palm Kernel, Coconut And/Or Cottonseed), Water, Oreo® Cookie Pieces (Enriched Unbleached Wheat Flour (Wheat Flour, Niacin, Reduced Iron, Thiamine Mononitrate, Riboflavin, Folic Acid), Sugar, Palm And/Or Canola Oil, Cocoa Alkali Processed, Invert Sugar, Leavening (Baking Soda And/Or Calcium Phosphate), Soy Lecithin, Salt, Chocolate, Natural Flavor), Contains Less Than 2% Of The Following: Sodium Caseinate (A Milk Derivative), Artificial Flavor, Sugar, Polysorbate 60, Carbohydrate Gum, Salt, To Preserve Freshness (Potassium Sorbate), Soy Lecithin, Polyglycerol Esters Of Fatty Acids, Soy Protein Concentrate, Xanthan Gum.


Id Keyallergens BE item Ingredient Statement Cross Contaminate
27milk, egg, wheat, soy, coconutyes Sugar, Water, Bleached Enriched Flour (Wheat Flour, Niacin, Reduced Iron, Thiamine Mononitrate, Riboflavin, Folic Acid), Vegetable Oil (Soybean Oil And/Or Palm Oil And/Or Canola Oil), Cocoa (Processed With Alkali), Dried Whole Eggs, Vegetable Shortening ( Propylene Glycol Mono- And Diesters Of Fats And Fatty Acids, Mono- And Diglycerides, Soy Lecithin). Contains 2% Or Less Of Each Of The Following: Nonfat Dry Milk, Modified Food Starch (Corn), Sodium Bicarbonate, Dried Egg Whites, Wheat Starch, Salt, Sodium Aluminum Phosphate, Mono- And Diglycerides, Emulsifier (Propylene Glycol Mono- And Diesters Of Fats And Fatty Acids, Mono- And Diglycerides, Soy Lecithin), Sodium Acid Pyrophosphate, Polysorbate 60, Artificial Flavor, Sodium Stearoyl Lactylate, Guar Gum, Monocalcium Phosphate, Xanthan Gum, Soy Flour, Vegetable Shortening (Polysorbate 60), High Fructose Corn Syrup, Corn Syrup, Corn Starch, Salt, Natural And Artificial Flavor, Phosphoric Acid, Guar Gum, Potassium Sorbate (Preservative), Sodium Benzoate. may contain other allergens due to shared facility.
29milk, egg, wheat, soyyessugar, water, bleached enriched flour (wheat flour, niacin, reduced iron, thiamine mononitrate, riboflavin, folic acid), vegetable oil (soybean oil and/or palm oil and/or canola oil), cocoa (processed with alkali), dried whole eggs, vegetable shortening (ropylene glycol mono- and diesters of fats and fatty acids, mono- and diglycerides, soy lecithin). contains 2% or less of each of the following: nonfat dry milk, modified food starch (corn), sodium bicarbonate, dried egg whites, wheat starch, salt, sodium aluminum phosphate, emulsifier, sodium acid pyrophosphate, polysorbate 60, artificial flavor, sodium stearoyl lactylate, guar gum, monocalcium phosphate, xanthan gum, soy flour, polysorbate 60),). contains 2% or less of each of the following: high fructose corn syrup, corn syrup, corn starch, natural and artificial flavor, phosphoric acid, potassium sorbate (preservative), sodium benzoate .
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
this is the desired outcome *
Id Keyallergens BE item Ingredient Statement
27milk, egg, wheat, soyyessugar, water, bleached enriched flour (wheat flour, niacin, reduced iron, thiamine mononitrate, riboflavin, folic acid), vegetable oil (soybean oil and/or palm oil and/or canola oil), cocoa (processed with alkali), dried whole eggs, vegetable shortening (ropylene glycol mono- and diesters of fats and fatty acids, mono- and diglycerides, soy lecithin). contains 2% or less of each of the following: nonfat dry milk, modified food starch (corn), sodium bicarbonate, dried egg whites, wheat starch, salt, sodium aluminum phosphate, emulsifier, sodium acid pyrophosphate, polysorbate 60, artificial flavor, sodium stearoyl lactylate, guar gum, monocalcium phosphate, xanthan gum, soy flour, polysorbate 60),). contains 2% or less of each of the following: high fructose corn syrup, corn syrup, corn starch, natural and artificial flavor, phosphoric acid, potassium sorbate (preservative), sodium benzoate .
29milk, egg, wheat, soy, coconutyesSugar, Water, Bleached Enriched Flour (Wheat Flour, Niacin, Reduced Iron, Thiamine Mononitrate, Riboflavin, Folic Acid), Vegetable Oil (Soybean Oil And/Or Palm Oil And/Or Canola Oil), Cocoa (Processed With Alkali), Dried Whole Eggs, Vegetable Shortening (Palm Oil, Soybean Oil, Propylene Glycol Mono- And Diesters Of Fats And Fatty Acids, Mono- And Diglycerides, Soy Lecithin). Contains 2% Or Less Of Each Of The Following: Nonfat Dry Milk, Modified Food Starch (Corn), Sodium Bicarbonate, Soy Lecithin, Dried Egg Whites, Wheat Starch, Salt, Sodium Aluminum Phosphate, Mono- And Diglycerides, Emulsifier (Propylene Glycol Mono- And Diesters Of Fats And Fatty Acids, Mono- And Diglycerides, Soy Lecithin), Sodium Acid Pyrophosphate, Polysorbate 60, Artificial Flavor, Sodium Stearoyl Lactylate, Guar Gum, Monocalcium Phosphate, Xanthan Gum, Soy Flour. High Fructose Corn Syrup, Hydrogenated Vegetable Oil ( Palm Kernel, Coconut And/Or Cottonseed), Water, Oreo® Cookie Pieces (Enriched Unbleached Wheat Flour (, Niacin, Reduced Iron, Thiamine Mononitrate, Riboflavin, Folic Acid), Palm And/Or Canola Oil, Cocoa Alkali Processed, Invert Sugar, Leavening (Baking Soda And/Or Calcium Phosphate), Chocolate, Natural Flavor), Contains Less Than 2% Of The Following: Sodium Caseinate (A Milk Derivative), Artificial Flavor, Sugar, Polysorbate 60, Carbohydrate Gum, Salt, To Preserve Freshness (Potassium Sorbate), Soy Protein Concentrate.
 
Upvote 0

Forum statistics

Threads
1,222,523
Messages
6,166,530
Members
452,048
Latest member
m_hakimi_a

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top