Find names and replace with translations

MrWouters

New Member
Joined
Aug 13, 2014
Messages
13
Hi,

I previously had some help from Istvan extracting the %'s of fabrics from certain cells. Now I would need to translate the different fabric types, just the names not the %'s of course.

So I have the English names as starting point. Now I need to translate them to Dutch and French (more in the future, but lets start with this)
but again, I only need to replace the fabric name so the x-amount of % needs to stay in front. I've taken a random example below.

Column AN Column AO Column AP
Material Description ENMaterial Description FRMaterial Description NL

<tbody>
</tbody>
40% Acrylic, 33% Polyester, 27% Wool

<tbody>
</tbody>
etc.........

In another file, I have the English names in Column A, French in Column B, Dutch in Column C.

ABC
EngFrNL
Acrylic Acrylique Acryl
PolyesterPolyesterPolyester
Wool Laine Wol

<colgroup><col width="72" span="3" style="width:54pt"> </colgroup><tbody>
</tbody>

Is there a formula I can use for this? I'm guessing any space between a two (or more) component fabric name will present a problem? So I would have to connect it with a - or something again?

Many thanks in advance once again for any support!

Regards,
Wouter
 
Last edited:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi,
Sorry, really no expert so not sure if I would be able to execute it?? But open to new learnings, sure..
 
Upvote 0
That's alright. I concluded that what you are asking is not impossible, but would require over an hour of my time. I'm too tired for that. Good night. Sorry.
 
Upvote 0
Hi, you could give this UDF a try:

Code:
Function translate(s As String, tbl As Range, col As Long) As String
Dim i As Long
translate = s
For i = 1 To tbl.Rows.Count
    translate = Replace(translate, tbl.Cells(i, 1), tbl.Cells(i, col))
Next i
End Function

To install the code;
1. In Excel press ALT+F11 to open the VBE
2. Click Insert > Module
3. Paste the code above to the window on the right
4. Save the file as a macro enabled workbook

You can then use the UDF as per the example below:

Excel Workbook
ABCDEFG
1EngFrNLMaterial Description ENMaterial Description FRMaterial Description NL
2AcrylicAcryliqueAcryl40% Acrylic, 33% Polyester, 27% Wool40% Acrylique, 33% Polyester, 27% Laine40% Acryl, 33% Polyester, 27% Wol
3PolyesterPolyesterPolyester
4WoolLaineWol
Sheet1
 
Upvote 0
Hi,

Wow ok, I'm gonna give it a shot! :) And I can pul this formula down the whole column then?
Can the fabric names in different languages be in another file as well? or at least in another tab? I now have them in another file.

And say I would add another language in Column D. Very sorry but I just got word German might be needed too. So Column D would be German then.
Woud I just expand the range in the formula? Or does the code need to be adjusted as well?

I'll go ahead and give this a go already anyway's. Many thanks!
 
Upvote 0
And I can pul this formula down the whole column then?

Yes.

Can the fabric names in different languages be in another file as well? or at least in another tab? I now have them in another file.

Different tab yes, different file - only if that file is open.

And say I would add another language in Column D. Very sorry but I just got word German might be needed too. So Column D would be German then.
Woud I just expand the range in the formula? Or does the code need to be adjusted as well?

The code wouldn't need to change - just expand the table and expand the formula to use the whole table, the 3rd argument of the function says which column to use for the "translated" words.

This version is not case sensitive - the first one was:
Code:
Function translate(s As String, tbl As Range, col As Long) As String
Dim i As Long
translate = s
For i = 1 To tbl.Rows.Count
    translate = Replace(translate, tbl.Cells(i, 1), tbl.Cells(i, col), , , vbTextCompare)
Next i
End Function

I'll go ahead and give this a go already anyway's. Many thanks!

Good luck, let us know how you get on!
 
Upvote 0
Wow this is really cool, it works! You knew that obviously ;) But I am already no expert, and in the area of Macro's or UDF's absolutely clueless even. But very cool this!

Only thing I cant figure out is below translation. I must be overlooking something?

I get below for Mohair.

18% Wool, 72% Polyamide, 10% Mohair18% Laine, 72% Polyamide, 10% MoPoil/crin18% Wol, 72% Polyamide, 10% MoHaar

<tbody>
</tbody>

While the table is as below:

WoolLaineWol
MohairMohairMohair
AlpacaAlpagaAlpaca

<tbody>
</tbody>

Wool it grabs just fine. What am I missing?
 
Last edited:
Upvote 0
Wool it grabs just fine. What am I missing?

Not sure, is that the full table of translations? Could you post the actual formula and the full translation table if it's not too excessively big?

Excel Workbook
ABCDE
1WoolLaineWol18% Wool, 72% Polyamide, 10% Mohair
2MohairMohairMohair18% Laine, 72% Polyamide, 10% Mohair
3AlpacaAlpagaAlpaca
Sheet2
 
Upvote 0
CellFormula
AO317=translate($AN317,'[Materials trans.xlsx]Fabric trans'!$A$2:$C$73,2)

<tbody>
</tbody>


This is the full translation table, as I said German was needed too so I added that one for now.

ABCD
1EngFrNLDe
2AbacaAbacaAbacaManilla
3AcetateAcétateAcetaatAzetat
4HempChanvreHennepHanf
5CoirFibre de cocoKokosKokos
6CottonCotonKatoenBaumwolle
7CuproCuproCuproCupro
8LyocellLyocellLyocellLyocell
9DownDuvetDonsDaune
10ElastaneElasthanneElasthanElasthan
11ElastodieneÉlastödièneElastodieenElastoiden
12FeatherPlumeVerenFeder
13FlaxLinVlasFlachs
14HairPoil/crinHaarHaar
15Cotton linenToile metisseHalf linenHalbleinen
16JuteJuteJuteJute
17KapokKapokKapokKapok
18LinenLinLinnenLeinen
19ModacrylicMadacryliqueModacrylModacryl
20ModalModalModalModal
21Métal métalliqueMetallischMetaalMetall
22PolyamidePolyamidePolyamidePolyamide
23AcrylicAcryliqueAcrylAcryl
24PolyethylenePolyéthylènePolyethyleenPolyäthylen
25PaperPapierPapierPapier
26PolyesterPolyesterPolyesterPolyester
27PVCPVCPVCPVC
28PolypropylenePolypropylènePolypropyleenPolypropylen
29PolyurethanePolyuréthannePolyurethaanPolyurethan
30RamieRamieRamieRamie
31SilkSoieZijdeSeide
32SisalSisalSisalSisal
33TriacetateTri-acétateTri-acetaatTriacetat
34Fiber blendMélange de fibresVezel
menging
Faser
mischung
35ViscoseViscoseViscoseViskose
36Viscose with PU coatingViscose avec Enduction PolyurethanneViscose met polyurethaan deklaagViskose mit Polyurethan beschichtung
37Polyester with PU
coating
Polyester avec Enduction
Polyurethanne
Polyester met
polyurethaan deklaag
Polyester mit
Polyurethan
beschichtung
38VinylVinylalVinylVinylal
39AngoraAngoraAngoraAngora
40BeaverCastorBeverBiber
41VicunaVicunaVicunaVikunja
42CamelChamaeuKameelKamel
43LamaVigogneLamaLama
44WoolLaineWolWolle
45MohairMohairMohairMohair
46AlpacaAlpagaAlpacaAlpaca
47Cashme
re
Cachemi
re
KasjmierKaschmi
r
48OtterLoutreOtterOtter
49GuanacoGuanacoGuanacoGuanako
50Virgin woolPure laine viegeZuiver ScheerwolReine Schurwolle
51Lambs woolLaine
d’agneau
LamswolLammwolle
52Merino woolLaine merinoMerino wolMerinowolle
53Shetland woolLaine d’ShetlandShetland wolShetlandwolle
54LambskinPeau d’agneauLamsvachtLammfell
55Other fibersAutres fibresAndere vezelsSonstige Fasern
56Pig suedeCochon suedeVarkens suedeSchweins leder
57SheepMoutonSchapenleerSchaf
58Genuine leatherCuir véritableEcht leerEchtes leder
59Pig leatherPécariVarkensleerSchweinleder
60Cow leatherCuir de vacheKoeien leerKuhleder
61YakYackYakYak
62Cow suedeSuède de vacheKoeien suedeKuhveloursleder
63CowVacheKoeKuh
64Buffalo leatherCuir de buffleBuffellederBüffelleder
65CopperCuivreKoperKupfer
66Goat leatherCuir de chèvreGeiten leerZeigefell
67Goat suedeChèvre veloursGeiten suedeZiegen velour
68Fake FurFourrure FausseNep BontNepp Pelz
69Rabbit furFourrure de lapinKonijnenbontKarnickelpelz
70TinÉtainTinZinn
71NeopreneNéoprèneNeopreneNeoprene
72StrawPailleStroStroh
73SteelAcierStaalStahl

<colgroup><col style="WIDTH: 30px; FONT-WEIGHT: bold"><col style="WIDTH: 163px"><col style="WIDTH: 248px"><col style="WIDTH: 223px"><col style="WIDTH: 252px"></colgroup><tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,500
Messages
6,125,168
Members
449,211
Latest member
ykrcory

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