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 = Mid(strNome, intCont, 1) Then strNomeJapones = strNomeJapones & strSilabas & " " End If Next yNext xNomeJapa = strNomeJaponesEnd Function