Translating A Spreadsheet

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,783
Office Version
  1. 365
Platform
  1. Windows
Hi, I have a large spreadsheet with a lot of data that is in Spanish. Is there any way or any code etc that would translate the whole spreadsheet to English? Thanks.
 
Great! Thanks so much for the quick response. This will be a huge help in translating text in Excel dumps of transactions. I shall be subscribing to your blog. :) I'll incorporate this and test it and let you know how it goes.

Matt
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Ok, so I tested and it works great! For example:

Input = "BIC - 琴师3月演奏费"
Output = "BIC - March musician playing fee"

This is awesome. I used to think I could code in vba, but I bow down to your skills. :)

The one caveat is that the "phonetic" option doesn't seem to work. For the same input, I just get a blank output (or for any Chinese input I tested for that matter). The formula I used was =Translate(D9, 12, 1, TRUE), whereas with the default "FALSE", it works fine.

Matt
 
Upvote 0
Hey Jon,

Is it possible to reference this site rather than google translate? dict.cc | Wörterbuch Englisch-Deutsch

I've been using your macro and it seems like the results from google translate arent coming back with the best conversions?

Wasnt sure how you grabbed the google translate hyperlink.

Please let me know if this is possible.

Thanks!
 
Upvote 0
It probably can be done, but the routine would be very very different. So a rewrite essentially, not an amendment.
 
Upvote 0
Thank You very much Jon and Cody :)

This was the perfect piece of code just at the right time judging by the posting dates.

It has been translating beautifully except for one sentce which I was trying to translate (I am posting in the hope this may help out othe users, if they have a similar problem)

The sentence that gave me the problem was this
"I here by declare that I have completed all work as detailed above in accordance with any relevant Technical Manual and/or device documentation"

Translating it into French the translate function returned
"Je déclare ici par ce que je viens de terminer tous les travaux comme indiqué ci-dessus"
Which is only about half of the string.

THE PROBLEM was the the full French translation had a "," in it.
"Je déclare ici par ce que je viens de terminer tous les travaux comme indiqué ci-dessus , conformément à toute Manuel technique pertinente et / ou la documentation de l'appareil"

This meant the function for stripping out the desired part of the string was spliting it at the "," and I only got the translation up to that point
For lngItem = 3 To UBound(varSplitText)
strTransText = strTransText & Split(varSplitText(lngItem), ",")(0)
Next

THE SOLUTION
The returned translated string looks like this "[Translated Text]","[Original Text]"
so change the delimiter to a ", and it will be able to identify the end of the translated string insted of the the first comma

This is what I did
Dim delimitChar as string
delimitChar = Chr(34) & "," 'Chr(34) is the character for "

change the problem line to
For lngItem = 3 To UBound(varSplitText)
strTransText = strTransText & Split(varSplitText(lngItem), delimitChar)(2)
Next

I am just a novice, but this solved the problem for me.
Maybe there is a nicer way to do this?

Could you tell me if this might lead to other problems, with other translations?

Thanks again guys, top piece of code:beerchug:
 
Upvote 0
I just found out I am getting the whole of other translations I was missing out on too (though I thought the reasons were different)
This fix works for anything with a comma in it.
like this line which I had returned without the list of numbers due to the comma separating them

"Performance and calibration checks; sections 8.1.2, 8.1.3, 8.1.4, (8.2.1, 8.2.2) of the Technical Manual" Translated to
"Contrôles de performance et d'étalonnage , les sections 8.1.2 , 8.1.3 , 8.1.4 , ( 8.2.1 , 8.2.2 ) du Manuel technique"

Instead of stripping all the numbers out!
 
Last edited:
Upvote 0
Hi All,

I am new to excel.Did Just copy paste stuff before.:(

I downloaded the file ,but It gives me error. Update code to use on 64 bit system.

Can anyone modify code to use on 64 bit.system.

Bye the way I am using win8 64bit and office 2013 64bit.


Thanks all :)
 
Upvote 0

Forum statistics

Threads
1,223,929
Messages
6,175,457
Members
452,643
Latest member
gjcase

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