Your name in "Japanese"

Leandroarb

Board Regular
Joined
Oct 7, 2014
Messages
157
Hello everyone, These days I got a picture with letters and their syllables to form so your name in "Japanese". From there I rode this simple function to automate this using arrays and For-Next loops. Maybe you can think "useless", but I believe that idleness is very productive and in those moments you create several good things.Copy and paste the code below into a new module, type your name in a cell type and function in the cell sheet informing you wrote your name.Function NomeJapa(rng As Range) As StringDim strLetras As VariantDim strSilabas As VariantDim strNome As StringDim x As ByteDim y As ByteDim intCont As IntegerDim strNomeJapones As StringstrNome = LCase(rng)intCont = 0strLetras = Array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")strSilabas = Array("ka", "tu", "mi", "te", "ku", "lu", "ji", "ri", "ki", "zu", "me", "ta", "rin", "to", "mo", "no", "ke", "shi", "ari", "chi", "do", "ru", "mei", "na", "fu", "ra")For x = 0 To Len(strNome)intCont = intCont + 1 For y = 0 To UBound(strLetras) If strLetras(y) = Mid(strNome, intCont, 1) Then strNomeJapones = strNomeJapones & strSilabas(y) & " " End If Next yNext xNomeJapa = strNomeJaponesEnd Function
 
Mr. Rick, sorry for my joke was not offensive in any way.
Just pasted your code in my spreadsheet and performed with his name, I hope I have not been insolent.
My comment in Message #8 was not directed at you... I understood what you were doing when you posted "Arigato Mr. Shikimime Shimochiriarichikukito!" and found it funny. If you look at the quoted section in Message #8, you will it was what 'shg' posted in Message #7. You may have missed it, but the word "these" in his original message was a hyperlink to a webpage about a contest for writing obfuscated (confusing, hard-to-read) code in a different programming language. He was joking that the compact code I write in VBA is hard to read... my comment in Message #8 was a joke back to him where I pretended that I did not think my code was hard to read (I do recognize that other might find it so even though I don't)... the way you could tell my comment was a joke was by the laughing emoticon at the end.
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Of course Mr. Rothstein, I realized you got the joke, only apologized for good manners.
Thansks, and warn that I use google to translate my texts if you have questions, do not hesitate to ask.
 
Upvote 0
Maybe they'll do one of these for VBA, Rick. You'd be a shoo-in!
If such a contest existed for VBA, I think refiguring the formula into a one-liner like this would give me the best chance of winning :LOL: ...
Code:
Function NomeJapa(ByVal S As String) As Variant
  NomeJapa = Application.Trim(Join(Evaluate(Replace(Replace("TRANSPOSE(SUBSTITUTE(MID("" ??ka?tu?mi?te?ku?lu?ji?ri?ki?zu?me?ta?rinto?mo?no?ke?shiarichido?ru?meina?fu?ra"",3*CODE(SUBSTITUTE(IF(ABS(109-CODE(MID(""@"",ROW(1:#),1)))<=13,MID(""@"",ROW(1:#),1),""`""),"" "",""`""))-287,3),""?"",""""))", "@", LCase(Left(S, 18))), "#", Application.Min(18, Len(S)))), "") & Join(Evaluate(Replace(Replace("TRANSPOSE(SUBSTITUTE(MID("" ??ka?tu?mi?te?ku?lu?ji?ri?ki?zu?me?ta?rinto?mo?no?ke?shiarichido?ru?meina?fu?ra"",3*CODE(SUBSTITUTE(IF(ABS(109-CODE(MID(""@"",ROW(1:#),1)))<=13,MID(""@"",ROW(1:#),1),""`""),"" "",""`""))-287,3),""?"",""""))", "@", Mid(S, 19, Application.Min(18, Len(S) - 18))), "#", Application.Max(0, Len(S) - 18))), ""))
End Function
 
Upvote 0
If such a contest existed for VBA, I think reconfiguring the formula into a one-liner like this would give me the best chance of winning :LOL: ...
Code:
Function NomeJapa(ByVal S As String) As Variant
  NomeJapa = Application.Trim(Join(Evaluate(Replace(Replace("TRANSPOSE(SUBSTITUTE(MID("" ??ka?tu?mi?te?ku?lu?ji?ri?ki?zu?me?ta?rinto?mo?no?ke?shiarichido?ru?meina?fu?ra"",3*CODE(SUBSTITUTE(IF(ABS(109-CODE(MID(""@"",ROW(1:#),1)))<=13,MID(""@"",ROW(1:#),1),""`""),"" "",""`""))-287,3),""?"",""""))", "@", LCase(Left(S, 18))), "#", Application.Min(18, Len(S)))), "") & Join(Evaluate(Replace(Replace("TRANSPOSE(SUBSTITUTE(MID("" ??ka?tu?mi?te?ku?lu?ji?ri?ki?zu?me?ta?rinto?mo?no?ke?shiarichido?ru?meina?fu?ra"",3*CODE(SUBSTITUTE(IF(ABS(109-CODE(MID(""@"",ROW(1:#),1)))<=13,MID(""@"",ROW(1:#),1),""`""),"" "",""`""))-287,3),""?"",""""))", "@", Mid(S, 19, Application.Min(18, Len(S) - 18))), "#", Application.Max(0, Len(S) - 18))), ""))
End Function
For those of you who want to have a better view of the code in order to more easily figure out how it works :)laugh:), here is the above one-liner laid out using line continuation characters to "neaten up" the display somewhat...
Code:
Function NomeJapa(ByVal S As String) As Variant
  NomeJapa = Application.Trim(Join(Evaluate(Replace(Replace( _
             "TRANSPOSE(SUBSTITUTE(MID("" ??ka?tu?mi?te?ku?" & _
             "lu?ji?ri?ki?zu?me?ta?rinto?mo?no?ke?shiarichi" & _
             "do?ru?meina?fu?ra"",3*CODE(SUBSTITUTE(IF(ABS(" & _
             "109-CODE(MID(""@"",ROW(1:#),1)))<=13,MID(""@""," & _
             "ROW(1:#),1),""`""),"" "",""`""))-287,3),""?"",""""))", _
             "@", LCase(Left(S, 18))), "#", Application.Min(18, _
             Len(S)))), "") & Join(Evaluate(Replace(Replace( _
             "TRANSPOSE(SUBSTITUTE(MID("" ??ka?tu?mi?te?ku?" & _
             "lu?ji?ri?ki?zu?me?ta?rinto?mo?no?ke?shiarichi" & _
             "do?ru?meina?fu?ra"",3*CODE(SUBSTITUTE(IF(ABS(" & _
             "109-CODE(MID(""@"",ROW(1:#),1)))<=13,MID(""@""," & _
             "ROW(1:#),1),""`""),"" "",""`""))-287,3),""?"",""""))", _
             "@", Mid(S, 19, Application.Min(18, Len(S) - 18))), _
             "#", Application.Max(0, Len(S) - 18))), ""))
End Function
Note though, for submission to the contest (if it existed), I would use the first version (the one without the line continuation characters because it is so much more obfuscated.
icon_twisted.gif
 
Last edited:
Upvote 0
For those of you who want to have a better view of the code in order to more easily figure out how it works :)laugh:), here is the above one-liner laid out using line continuation characters to "neaten up" the display somewhat...
Code:
Function NomeJapa(ByVal S As String) As Variant
  NomeJapa = Application.Trim(Join(Evaluate(Replace(Replace( _
             "TRANSPOSE(SUBSTITUTE(MID("" ??ka?tu?mi?te?ku?" & _
             "lu?ji?ri?ki?zu?me?ta?rinto?mo?no?ke?shiarichi" & _
             "do?ru?meina?fu?ra"",3*CODE(SUBSTITUTE(IF(ABS(" & _
             "109-CODE(MID(""@"",ROW(1:#),1)))<=13,MID(""@""," & _
             "ROW(1:#),1),""`""),"" "",""`""))-287,3),""?"",""""))", _
             "@", LCase(Left(S, 18))), "#", Application.Min(18, _
             Len(S)))), "") & Join(Evaluate(Replace(Replace( _
             "TRANSPOSE(SUBSTITUTE(MID("" ??ka?tu?mi?te?ku?" & _
             "lu?ji?ri?ki?zu?me?ta?rinto?mo?no?ke?shiarichi" & _
             "do?ru?meina?fu?ra"",3*CODE(SUBSTITUTE(IF(ABS(" & _
             "109-CODE(MID(""@"",ROW(1:#),1)))<=13,MID(""@""," & _
             "ROW(1:#),1),""`""),"" "",""`""))-287,3),""?"",""""))", _
             "@", Mid(S, 19, Application.Min(18, Len(S) - 18))), _
             "#", Application.Max(0, Len(S) - 18))), ""))
End Function
Note though, for submission to the contest (if it existed), I would use the first version (the one without the line continuation characters because it is so much more obfuscated. :devilish:

I forgot to mention... the above function (either version) has a maximum limit of 36 characters (including space and punctuation, if any) due to the 255-character limit for the evaluated argument for the Evaluate function.
 
Upvote 0
I think either would be excellent submittals. Maybe there should be a separate forum for posts intended as paeans to one's cleverness versus assisting OPs.
 
Last edited:
Upvote 0
Maybe there should be a separate forum for posts intended as paeans to one's cleverness versus assisting OPs.
I know you understood, but lest the humor of it all is lost on some of the readers of this thread....

under no circumstance should anyone consider using either of the one-liner functions I posted...

they were constructed for the "fun of it", mainly in reaction to the link shg posted in Message #7, basically (no pun intended) to see if I could do it (I enjoy making self-challenges to myself like this).
 
Upvote 0
Just dropped by here as a person who has japanese name. Thanks for interesting postings guys!
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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