' Il nome del corrente modulo VBA (Visual Basic for Application) ' deve iniziare con i caratteri "Modulo" ed avere estensione ".bas". ' Per importarlo dentro un Excel 2007 ".xlsm" (con macro attivate), esegui ' Sviluppo, Visual Basic, File, Importa file... ' e, infine, scegli il file corrente dalla finestra di importazione. ' Attribute VB_Name = "Modulo_XLTNBR" Option Explicit Function XLTNBR(Nbr As Double, Lingua As String) As String 'Translate Number to Letters. 'Traduce un numero in lettere. 'Riceve il numero di 12 cifre al massimo. 'Riceve la lingua in cui tradurre. 'ITA=Italiano FRA=Francese ENG=Inglese DEU=Tedesco NED=Olandese ESP=Spagnolo 'Per LUM=Lumbard c'è da aspettare ancora un po' perché contiene 'il maggior numero e varietà di regole. 'Restituisce la traduzione del numero in lettere. 'Dichiara le variabili. Dim NbrInt As Double Dim T4 As Double Dim T4Z As Double Dim T3 As Double Dim T3Z As Double Dim T2 As Double Dim T2Z As Double Dim T1 As Double 'Rialza la lingua. Lingua = UCase(Lingua) 'Controlla che la lingua sia prevista. XLTNBR = XNumero(0, Lingua) If XLTNBR <> "" Then GoTo Fine 'Si assicura che il numero sia intero. NbrInt = Int(Nbr) 'Controlla numero troppo grande. Do While NbrInt < 1000000000000# 'Estrae miliardi. T4 = Int(NbrInt / 1000000000) T4Z = T4 * 1000000000 'Estrae milioni. T3 = Int((NbrInt - T4Z) / 1000000) T3Z = T3 * 1000000 'Estrae migliaia. T2 = Int((NbrInt - T4Z - T3Z) / 1000) T2Z = T2 * 1000 'Estrae unità. T1 = Int(NbrInt - T4Z - T3Z - T2Z) 'Traduce i miliardi. XLTNBR = XTERNA(T4, 4, Lingua) 'Se sono presenti miliardi e uno tra milioni, migliaia e unità, inserisce congiunzione. If T4 <> 0 And (T3 <> 0 Or T2 <> 0 Or T1 <> 0) Then XLTNBR = XLTNBR & XNumero(-2, Lingua) End If 'Traduce i milioni. XLTNBR = XLTNBR & XTERNA(T3, 3, Lingua) 'Se sono presenti milioni e uno tra migliaia e unità, inserisce congiunzione. If T3 <> 0 And (T2 <> 0 Or T1 <> 0) Then XLTNBR = XLTNBR & XNumero(-2, Lingua) End If 'Traduce le migliaia. XLTNBR = XLTNBR & XTERNA(T2, 2, Lingua) 'Se sono presenti migliaia e unità, inserisce congiunzione. If T2 <> 0 And T1 <> 0 Then XLTNBR = XLTNBR & XNumero(-2, Lingua) End If 'Traduce le unità. XLTNBR = XLTNBR & XTERNA(T1, 1, Lingua) Exit Do Loop Fine: End Function Private Function XTERNA(Terna As Double, LivelloTerna As Double, Lingua As String) As String 'Traduce una terna di cifre in lettere. 'Riceve le tre cifre da tradurre. 'Riceve il livello della terna (1=unità 2=migliaia 3=milioni 4=miliardi). 'Restituisce la traduzione in lettere. 'Dichiara le variabili. Dim Centinaia As Double Dim Decine As Double Dim Unita As Double Dim DecineUnita As Double Dim CongiunzioneUniEDec As String 'Tedesco e Olandese Dim UnoPlurale As String 'Tedesco Dim Ottantina As String 'Francese Dim TreFormeDecine As String 'Lombardo Dim TutteLeCentinaia As String 'Lombardo 'Isola le tre cifre. Centinaia = Int(Terna / 100) Decine = Int((Terna - Centinaia * 100) / 10) Unita = Terna - Centinaia * 100 - Decine * 10 'Evidenzia decine + unità. DecineUnita = Decine * 10 + Unita 'Annota la congiunzione UnitàEDecine per la traduzione alla tedesca. CongiunzioneUniEDec = XNumero(-3, Lingua) 'Annota l'uno plurale per la traduzione alla tedesca. UnoPlurale = XNumero(111, Lingua) 'Annota la richiesta dell'ottantina per la traduzione alla francese. Ottantina = XNumero(-4, Lingua) 'Annota la richiesta delle tre forme delle decine per la traduzione alla lombarda. TreFormeDecine = XNumero(32, Lingua) 'Annota la richiesta delle centinaia per la traduzione alla lombarda. TutteLeCentinaia = XNumero(300, Lingua) 'Esegue se la terna è significativa. Do While Terna > 0 'Se la terna vale 1. If Terna = 1 Then 'Sceglie la dicitura corrispondente al livello. Select Case LivelloTerna Case Is = 1 XTERNA = XNumero(1, Lingua) 'uno Case Is = 2 XTERNA = XNumero(1000, Lingua) 'mille Case Is = 3 XTERNA = XNumero(1000000, Lingua) 'unmilione Case Is = 4 XTERNA = XNumero(1000000000, Lingua) 'unmiliardo End Select 'Abbandona. Exit Do 'Se la terna vale 1. End If 'Se richeste tutte le centinaia. If (TutteLeCentinaia <> "") Then 'Se la terna vale centinaia tonde. If (Centinaia > 0 And DecineUnita = 0) Then 'Traduce centinaia tonde. XTERNA = XTERNA & XNumero(Terna, Lingua) 'cento tondo 'Abbandona. Exit Do End If 'Se presenti centinaia. If Centinaia > 0 Then 'Traduce le centinaia. XTERNA = XNumero(Centinaia * 100 + 1, Lingua) End If 'Se non richeste tutte le centinaia. Else 'Se la terna vale 100. If Terna = 100 Then 'Traduce cento tondo. Serve spagnolo. XTERNA = XTERNA & XNumero(100, Lingua) 'cento tondo 'Abbandona. Exit Do 'Se la terna vale 100. End If 'Se presenti più centinaia. If Centinaia > 1 Then 'Traduce le centinaia. XTERNA = XNumero(Centinaia, Lingua) End If 'Se presenti le centinaia, aggiunge la dicitura cento. If Centinaia > 0 Then XTERNA = XTERNA & XNumero(200, Lingua) 'cento plurale End If 'Se richiesto uno plurale e corre C01 (Centinaia+DecineZero+UnitàUno) 'per la terna delle unità. If UnoPlurale <> "" And DecineUnita = 1 And LivelloTerna = 1 Then 'Traduce l'uno plurale. XTERNA = XTERNA & XNumero(111, Lingua) 'Abbandona. Exit Do 'Se richiesto uno plurale e corre C01 (Centinaia+DecineZero+UnitàUno). End If 'Se presenti contemporaneamente centinaia e decine-unità compreso tra 1 e 19. If Centinaia > 0 And DecineUnita >= 1 And DecineUnita <= 19 Then 'Aggiunge la congiunzione tra le due parti. XTERNA = XTERNA & XNumero(-1, Lingua) End If 'Se non richeste tutte le centinaia. End If 'Se decine-unità è inferiore a 20. If DecineUnita < 20 Then 'Traduce insieme decine e unità. XTERNA = XTERNA & XNumero(DecineUnita, Lingua) 'Abbandona. Exit Do 'Se decine-unità è inferiore a 20. End If 'Se richeste le tre forme decine. If (TreFormeDecine <> "") Then 'Se le decine sono due o più e sono tonde. If (Decine >= 2 And Unita = 0) Then 'Traduce le decine. XTERNA = XTERNA & XNumero(DecineUnita, Lingua) 'Abbandona. Exit Do 'Se le decine sono due o più e sono tonde. End If 'Se le decine sono due o più. If Decine >= 2 Then 'Se le unità chiedono troncatura della dicitura decine. If (Unita = 1 Or Unita = 8) Then 'Traduce le decine troncate XTERNA = XTERNA & XNumero(Decine * 10 + 1, Lingua) 'Traduce le unità elise. XTERNA = XTERNA & XNumero(1000 + Unita, Lingua) Else 'Traduce le decine non troncate. XTERNA = XTERNA & XNumero(Decine * 10 + 2, Lingua) 'Traduce le unità. XTERNA = XTERNA & XNumero(Unita, Lingua) End If 'Se le decine sono due o più. End If 'Abbandona. Exit Do 'Se non richeste le tre forme decine. Else 'Se decine-unità è superiore a 80 ed è richiesta l'ottantina alla francese. If DecineUnita > 80 And Ottantina <> "" Then 'Traduce 80 e qualcosa. XTERNA = XTERNA & XNumero(80, Lingua) & XNumero(DecineUnita - 80, Lingua) 'Abbandona. Exit Do 'Se decine-unità è superiore a 80 ed è richiesta l'ottantina alla francese. End If 'Se le decine sono due o più. If Decine >= 2 Then 'Se richiesta traduzione DecineUnità. If CongiunzioneUniEDec = "" Then 'Se le unità chiedono troncatura della dicitura decine. If (Unita = 1 Or Unita = 8) Then 'Traduce le decine troncate. XTERNA = XTERNA & XNumero(Decine * 10 + 1, Lingua) 'Se le unità non chiedono troncatura della dicitura decine. Else 'Traduce le decine non troncate. XTERNA = XTERNA & XNumero(Decine * 10, Lingua) 'Se le unità non chiedono troncatura della dicitura decine. End If 'Se significative, traduce le unità. If Unita >= 1 Then XTERNA = XTERNA & XNumero(Unita, Lingua) End If 'Se richiesta traduzione UnitàEDecine. Else 'Se significative, traduce le unità. If Unita >= 1 Then XTERNA = XTERNA & XNumero(Unita, Lingua) & CongiunzioneUniEDec End If 'Traduce le decine. XTERNA = XTERNA & XNumero(Decine * 10, Lingua) 'Se richiesta traduzione UnitàEDecine. End If 'Se le decine sono due o più. End If 'Se non richeste le tre forme decine. End If 'Abbandona. Exit Do 'Esegue se la terna è significativa. Loop 'Se la terna vale più di 1. If Terna > 1 Then 'Sulla base del livello, aggiunge la dicitura che lo esprime. Select Case LivelloTerna Case Is = 2 XTERNA = XTERNA & XNumero(2000, Lingua) 'mila Case Is = 3 XTERNA = XTERNA & XNumero(2000000, Lingua) 'milioni Case Is = 4 XTERNA = XTERNA & XNumero(2000000000, Lingua) 'miliardi End Select 'Se la terna vale più di 1. End If End Function Private Function XNumero(Numero As Double, Lingua As String) As String Select Case Lingua Case Is = "ITA" XNumero = XNumeroITA(Numero) Case Is = "FRA" XNumero = XNumeroFRA(Numero) Case Is = "ENG" XNumero = XNumeroENG(Numero) Case Is = "DEU" XNumero = XNumeroDEU(Numero) Case Is = "NED" XNumero = XNumeroNED(Numero) Case Is = "ESP" XNumero = XNumeroESP(Numero) Case Is = "LUM" XNumero = XNumeroLUM(Numero) Case Else XNumero = "Lingua errata " & Lingua End Select End Function Private Function XNumeroITA(Numero As Double) As String 'Traduce numero in Italiano. 'Tutte le costanti sono radunate in questa funzione, anche quelle inutili (valore ""), 'per facilitarne la traduzione. Select Case Numero Case Is = -1 XNumeroITA = "" 'congiunzione CentinaiaEDecineUnità Case Is = -2 XNumeroITA = "" 'congiunzione tra terne significative Case Is = -3 XNumeroITA = "" 'congiunzione UnitàEDecine Case Is = -4 XNumeroITA = "" 'ottantina francese Case Is = 1 XNumeroITA = "uno" 'uno Case Is = 111 XNumeroITA = "" 'uno plurale (x01 nelle unità) Case Is = 2 XNumeroITA = "due" 'due Case Is = 3 XNumeroITA = "tre" 'tre Case Is = 4 XNumeroITA = "quattro" 'quattro Case Is = 5 XNumeroITA = "cinque" 'cinque Case Is = 6 XNumeroITA = "sei" 'sei Case Is = 7 XNumeroITA = "sette" 'sette Case Is = 8 XNumeroITA = "otto" 'otto Case Is = 9 XNumeroITA = "nove" 'nove Case Is = 10 XNumeroITA = "dieci" 'dieci Case Is = 11 XNumeroITA = "undici" 'undici Case Is = 12 XNumeroITA = "dodici" 'dodici Case Is = 13 XNumeroITA = "tredici" 'tredici Case Is = 14 XNumeroITA = "quattordici" 'quattordici Case Is = 15 XNumeroITA = "quindici" 'quindici Case Is = 16 XNumeroITA = "sedici" 'sedici Case Is = 17 XNumeroITA = "diciassette" 'diciassette Case Is = 18 XNumeroITA = "diciotto" 'diciotto Case Is = 19 XNumeroITA = "diciannove" 'diciannove Case Is = 20 XNumeroITA = "venti" 'venti Case Is = 21 XNumeroITA = "vent" 'vent Case Is = 30 XNumeroITA = "trenta" 'trenta Case Is = 31 XNumeroITA = "trent" 'trent Case Is = 40 XNumeroITA = "quaranta" 'quaranta Case Is = 41 XNumeroITA = "quarant" 'quarant Case Is = 50 XNumeroITA = "cinquanta" 'cinquanta Case Is = 51 XNumeroITA = "cinquant" 'cinquant Case Is = 60 XNumeroITA = "sessanta" 'sessanta Case Is = 61 XNumeroITA = "sessant" 'sessant Case Is = 70 XNumeroITA = "settanta" 'settanta Case Is = 71 XNumeroITA = "settant" 'settant Case Is = 80 XNumeroITA = "ottanta" 'ottanta Case Is = 81 XNumeroITA = "ottant" 'ottant Case Is = 90 XNumeroITA = "novanta" 'novanta Case Is = 91 XNumeroITA = "novant" 'novant Case Is = 100 XNumeroITA = "cento" 'cento tondo Case Is = 200 XNumeroITA = "cento" 'cento plurale Case Is = 1000 XNumeroITA = "mille" 'mille Case Is = 2000 XNumeroITA = "mila" 'mila Case Is = 1000000 XNumeroITA = "unmilione" 'unmilione Case Is = 2000000 XNumeroITA = "milioni" 'milioni Case Is = 1000000000 XNumeroITA = "unmiliardo" 'unmiliardo Case Is = 2000000000 XNumeroITA = "miliardi" 'miliardi End Select End Function Private Function XNumeroFRA(Numero As Double) As String 'Traduce numero in Francese. Select Case Numero Case Is = -4 XNumeroFRA = "x" 'ottantina francese Case Is = 1 XNumeroFRA = "un" 'uno Case Is = 2 XNumeroFRA = "deux" 'due Case Is = 3 XNumeroFRA = "trois" 'tre Case Is = 4 XNumeroFRA = "quatre" 'quattro Case Is = 5 XNumeroFRA = "cinq" 'cinque Case Is = 6 XNumeroFRA = "six" 'sei Case Is = 7 XNumeroFRA = "sept" 'sette Case Is = 8 XNumeroFRA = "huit" 'otto Case Is = 9 XNumeroFRA = "neuf" 'nove Case Is = 10 XNumeroFRA = "dix" 'dieci Case Is = 11 XNumeroFRA = "onze" 'undici Case Is = 12 XNumeroFRA = "douze" 'dodici Case Is = 13 XNumeroFRA = "treize" 'tredici Case Is = 14 XNumeroFRA = "quatorze" 'quattordici Case Is = 15 XNumeroFRA = "quinze" 'quindici Case Is = 16 XNumeroFRA = "seize" 'sedici Case Is = 17 XNumeroFRA = "dixsept" 'diciassette Case Is = 18 XNumeroFRA = "dixhuit" 'diciotto Case Is = 19 XNumeroFRA = "dixneuf" 'diciannove Case Is = 20, 21 XNumeroFRA = "vingt" 'venti Case Is = 30, 31 XNumeroFRA = "trente" 'trenta Case Is = 40, 41 XNumeroFRA = "quarante" 'quaranta Case Is = 50, 51 XNumeroFRA = "cinquante" 'cinquanta Case Is = 60, 61 XNumeroFRA = "soixante" 'sessanta Case Is = 70, 71 XNumeroFRA = "soixantedix" 'settanta Case Is = 80, 81 XNumeroFRA = "quatrevingt" 'ottanta Case Is = 90, 91 XNumeroFRA = "quatrevingtdix" 'novanta 'inutilizzato Case Is = 100, 200 XNumeroFRA = "cent" 'cento Case Is = 1000, 2000 XNumeroFRA = "mill" 'mille Case Is = 1000000 XNumeroFRA = "unmillion" 'unmilione Case Is = 2000000 XNumeroFRA = "millions" 'milioni Case Is = 1000000000 XNumeroFRA = "unmilliard" 'unmiliardo Case Is = 2000000000 XNumeroFRA = "milliards" 'miliardi End Select End Function Private Function XNumeroENG(Numero As Double) As String 'Traduce numero in Inglese. Select Case Numero Case Is = 1 XNumeroENG = "one" 'uno Case Is = 2 XNumeroENG = "two" 'due Case Is = 3 XNumeroENG = "three" 'tre Case Is = 4 XNumeroENG = "four" 'quattro Case Is = 5 XNumeroENG = "five" 'cinque Case Is = 6 XNumeroENG = "six" 'sei Case Is = 7 XNumeroENG = "seven" 'sette Case Is = 8 XNumeroENG = "eight" 'otto Case Is = 9 XNumeroENG = "nine" 'nove Case Is = 10 XNumeroENG = "ten" 'dieci Case Is = 11 XNumeroENG = "eleven" 'undici Case Is = 12 XNumeroENG = "twelve" 'dodici Case Is = 13 XNumeroENG = "thirteen" 'tredici Case Is = 14 XNumeroENG = "fourteen" 'quattordici Case Is = 15 XNumeroENG = "fifteen" 'quindici Case Is = 16 XNumeroENG = "sixteen" 'sedici Case Is = 17 XNumeroENG = "seventeen" 'diciassette Case Is = 18 XNumeroENG = "eighteen" 'diciotto Case Is = 19 XNumeroENG = "nineteen" 'diciannove Case Is = 20, 21 XNumeroENG = "twenty" 'venti Case Is = 30, 31 XNumeroENG = "thirty" 'trenta Case Is = 40, 41 XNumeroENG = "forty" 'quaranta Case Is = 50, 51 XNumeroENG = "fifty" 'cinquanta Case Is = 60, 61 XNumeroENG = "sixty" 'sessanta Case Is = 70, 71 XNumeroENG = "seventy" 'settanta Case Is = 80, 81 XNumeroENG = "eighty" 'ottanta Case Is = 90, 91 XNumeroENG = "ninety" 'novanta Case Is = 100, 200 XNumeroENG = "hundred" 'cento tondo Case Is = 1000, 2000 XNumeroENG = "thousand" 'mille Case Is = 1000000 XNumeroENG = "onemillion" 'unmilione Case Is = 2000000 XNumeroENG = "millions" 'milioni Case Is = 1000000000 XNumeroENG = "onemilliard" 'unmiliardo Case Is = 2000000000 XNumeroENG = "milliards" 'miliardi End Select End Function Private Function XNumeroDEU(Numero As Double) As String 'Traduce numero in Tedesco. Select Case Numero Case Is = -3 XNumeroDEU = "und" 'congiunzione UnitàEDecine Case Is = 1 XNumeroDEU = "ein" 'uno Case Is = 111 XNumeroDEU = "eins" 'uno plurale (x01 nelle unità) Case Is = 2 XNumeroDEU = "zwei" 'due Case Is = 3 XNumeroDEU = "drei" 'tre Case Is = 4 XNumeroDEU = "vier" 'quattro Case Is = 5 XNumeroDEU = "fuenf" 'cinque Case Is = 6 XNumeroDEU = "sechs" 'sei Case Is = 7 XNumeroDEU = "sieben" 'sette Case Is = 8 XNumeroDEU = "acht" 'otto Case Is = 9 XNumeroDEU = "neun" 'nove Case Is = 10 XNumeroDEU = "zehn" 'dieci Case Is = 11 XNumeroDEU = "elf" 'undici Case Is = 12 XNumeroDEU = "zwoelf" 'dodici Case Is = 13 XNumeroDEU = "dreizehn" 'tredici Case Is = 14 XNumeroDEU = "vierzehn" 'quattordici Case Is = 15 XNumeroDEU = "fuenfzehn" 'quindici Case Is = 16 XNumeroDEU = "sechzehn" 'sedici Case Is = 17 XNumeroDEU = "siebzehn" 'diciassette Case Is = 18 XNumeroDEU = "achtzehn" 'diciotto Case Is = 19 XNumeroDEU = "neunzehn" 'diciannove Case Is = 20, 21 XNumeroDEU = "zwanzig" 'venti Case Is = 30, 31 XNumeroDEU = "dreissig" 'trenta Case Is = 40, 41 XNumeroDEU = "vierzig" 'quaranta Case Is = 50, 51 XNumeroDEU = "fuenfzig" 'cinquanta Case Is = 60, 61 XNumeroDEU = "sechzig" 'sessanta Case Is = 70, 71 XNumeroDEU = "siebzig" 'settanta Case Is = 80, 81 XNumeroDEU = "achtzig" 'ottanta Case Is = 90, 91 XNumeroDEU = "neunzig" 'novanta Case Is = 100, 200 XNumeroDEU = "hundert" 'cento Case Is = 1000, 2000 XNumeroDEU = "thausend" 'mille Case Is = 1000000 XNumeroDEU = "einemillion" 'unmilione Case Is = 2000000 XNumeroDEU = "millionen" 'milioni Case Is = 1000000000 XNumeroDEU = "einemilliarde" 'unmiliardo Case Is = 2000000000 XNumeroDEU = "milliarden" 'miliardi End Select End Function Private Function XNumeroNED(Numero As Double) As String 'Traduce numero in Olandese. Select Case Numero Case Is = -3 XNumeroNED = "en" 'congiunzione UnitàEDecine Case Is = 1 XNumeroNED = "een" 'uno Case Is = 2 XNumeroNED = "twee" 'due Case Is = 3 XNumeroNED = "drie" 'tre Case Is = 4 XNumeroNED = "vier" 'quattro Case Is = 5 XNumeroNED = "vijf" 'cinque Case Is = 6 XNumeroNED = "zes" 'sei Case Is = 7 XNumeroNED = "zeven" 'sette Case Is = 8 XNumeroNED = "acht" 'otto Case Is = 9 XNumeroNED = "negen" 'nove Case Is = 10 XNumeroNED = "tien" 'dieci Case Is = 11 XNumeroNED = "elf" 'undici Case Is = 12 XNumeroNED = "twaalf" 'dodici Case Is = 13 XNumeroNED = "dertien" 'tredici Case Is = 14 XNumeroNED = "veertien" 'quattordici Case Is = 15 XNumeroNED = "vijftien" 'quindici Case Is = 16 XNumeroNED = "zestien" 'sedici Case Is = 17 XNumeroNED = "zeventien" 'diciassette Case Is = 18 XNumeroNED = "achttien" 'diciotto Case Is = 19 XNumeroNED = "negentien" 'diciannove Case Is = 20, 21 XNumeroNED = "twintig" 'venti Case Is = 30, 31 XNumeroNED = "dertig" 'trenta Case Is = 40, 41 XNumeroNED = "veertig" 'quaranta Case Is = 50, 51 XNumeroNED = "vijftig" 'cinquanta Case Is = 60, 61 XNumeroNED = "zestig" 'sessanta Case Is = 70, 71 XNumeroNED = "zeventig" 'settanta Case Is = 80, 81 XNumeroNED = "achttig" 'ottanta Case Is = 90, 91 XNumeroNED = "negentig" 'novanta Case Is = 100, 200 XNumeroNED = "honderd" 'cento 'o handerd? Case Is = 1000, 2000 XNumeroNED = "duizend" 'mille Case Is = 1000000 XNumeroNED = "eenmiljoen" 'unmilione Case Is = 2000000 XNumeroNED = "miljoen" 'milioni Case Is = 1000000000 XNumeroNED = "eenmilliarden" 'unmiliardo ????? Case Is = 2000000000 XNumeroNED = "milliarden" 'miliardi ????? End Select End Function Private Function XNumeroESP(Numero As Double) As String 'Traduce numero in Spagnolo maschile. Femminile solo tra 1 e 999. Select Case Numero Case Is = -1 XNumeroESP = "y" 'congiunzione CentinaiaEDecineUnità Case Is = 1 XNumeroESP = "uno" 'uno femminile: una Case Is = 2 XNumeroESP = "dos" 'due Case Is = 3 XNumeroESP = "tres" 'tre Case Is = 4 XNumeroESP = "cuatro" 'quattro Case Is = 5 XNumeroESP = "cinco" 'cinque Case Is = 6 XNumeroESP = "seis" 'sei Case Is = 7 XNumeroESP = "siete" 'sette Case Is = 8 XNumeroESP = "ocho" 'otto Case Is = 9 XNumeroESP = "nueve" 'nove Case Is = 10 XNumeroESP = "diez" 'dieci Case Is = 11 XNumeroESP = "once" 'undici Case Is = 12 XNumeroESP = "doce" 'dodici Case Is = 13 XNumeroESP = "trece" 'tredici Case Is = 14 XNumeroESP = "catorce" 'quattordici Case Is = 15 XNumeroESP = "quice" 'quindici Case Is = 16 XNumeroESP = "dieciseis" 'sedici Case Is = 17 XNumeroESP = "diecisiete" 'diciassette Case Is = 18 XNumeroESP = "dieciocho 'diciotto" Case Is = 19 XNumeroESP = "diecinueve" 'diciannove Case Is = 20, 21 XNumeroESP = "veinte" 'venti Case Is = 30, 31 XNumeroESP = "treinta" 'trenta Case Is = 40, 41 XNumeroESP = "quarenta" 'quaranta Case Is = 50, 51 XNumeroESP = "cincuenta" 'cinquanta Case Is = 60, 61 XNumeroESP = "sesenta" 'sessanta Case Is = 70, 71 XNumeroESP = "setenta" 'settanta Case Is = 80, 81 XNumeroESP = "ochenta" 'ottanta Case Is = 90, 91 XNumeroESP = "noventa" 'novanta Case Is = 100 XNumeroESP = "cien" 'cento tondo Case Is = 200 XNumeroESP = "cientos" 'cento plurale femminile: cientas Case Is = 1000, 2000 XNumeroESP = "mil" 'mille Case Is = 1000000 XNumeroESP = "unmillon" 'unmilione Case Is = 2000000 XNumeroESP = "millones" 'milioni Case Is = 1000000000 XNumeroESP = "unmillardo" 'unmiliardo dubbio su "un" Case Is = 2000000000 XNumeroESP = "millardos" 'miliardi dubbio End Select End Function Private Function XNumeroLUM(Numero As Double) As String 'Traduce numero in Lombardo. 'Far revisionare da un madrelingua comasco. 'milaevun 'tremila 'quater 'inserire una e tra le terne significative 'cent dusent tresent quatarcent cincent sescent setcent votcent nofcent 'vint vint un vinti du vinti tri vinti quater vinti cinq vinti ses vinti set vint ot vinti nof 'trenta trentun trentadu trentatri trentaquater trentacinq trentases trentaset trentot trentanof Dim x As Double x = 1 Select Case Numero Case Is = -2 XNumeroLUM = "e" 'e tra terne significative Case Is = 1 XNumeroLUM = "vun" Case Is = 1001 XNumeroLUM = "un" Case Is = 2, 1002 XNumeroLUM = "du" Case Is = 3, 1003 XNumeroLUM = "tri" Case Is = 4, 1004 XNumeroLUM = "quater" 'comasco quatar Case Is = 5, 1005 XNumeroLUM = "cinc" Case Is = 6, 1006 XNumeroLUM = "ses" Case Is = 7, 1006 XNumeroLUM = "set" Case Is = 8 XNumeroLUM = "vot" Case Is = 1008 XNumeroLUM = "ot" Case Is = 9, 1009 XNumeroLUM = "nof" Case Is = 10 XNumeroLUM = "des" Case Is = 11 XNumeroLUM = "vundes" Case Is = 12 XNumeroLUM = "dudes" 'dudas Case Is = 13 XNumeroLUM = "tredes" 'tredas Case Is = 14 XNumeroLUM = "quatordes" 'quatordas Case Is = 15 XNumeroLUM = "quindes" 'quindas Case Is = 16 XNumeroLUM = "sedes" 'sedas Case Is = 17 XNumeroLUM = "derset" Case Is = 18 XNumeroLUM = "desdot" Case Is = 19 XNumeroLUM = "desnof" Case Is = 20, 21 XNumeroLUM = "vint" Case Is = 22 XNumeroLUM = "vinti" Case Is = 30, 32 XNumeroLUM = "trenta" Case Is = 31 XNumeroLUM = "trent" Case Is = 40, 42 XNumeroLUM = "quaranta" Case Is = 41 XNumeroLUM = "quarant" Case Is = 50, 52 XNumeroLUM = "cinquanta" Case Is = 51 XNumeroLUM = "cinquant" Case Is = 60, 62 XNumeroLUM = "sesanta" Case Is = 61 XNumeroLUM = "sesant" Case Is = 70, 72 XNumeroLUM = "setanta" Case Is = 71 XNumeroLUM = "setant" Case Is = 80, 82 XNumeroLUM = "vutanta" Case Is = 81 XNumeroLUM = "vutant" Case Is = 90, 92 XNumeroLUM = "nuanta" Case Is = 91 XNumeroLUM = "nuant" Case Is = 100 XNumeroLUM = "cent" Case Is = 101 XNumeroLUM = "cen" Case Is = 200 XNumeroLUM = "dusent" Case Is = 201 XNumeroLUM = "dusen" Case Is = 300 XNumeroLUM = "tresent" Case Is = 301 XNumeroLUM = "tresen" Case Is = 400 XNumeroLUM = "quatarcent" Case Is = 401 XNumeroLUM = "quatarcen" Case Is = 500 XNumeroLUM = "cincent" Case Is = 501 XNumeroLUM = "cincen" Case Is = 600 XNumeroLUM = "sescent" Case Is = 601 XNumeroLUM = "sescen" Case Is = 700 XNumeroLUM = "setcent" Case Is = 701 XNumeroLUM = "setcen" Case Is = 800 XNumeroLUM = "votcent" Case Is = 801 XNumeroLUM = "votcen" Case Is = 900 XNumeroLUM = "nofcent" Case Is = 901 XNumeroLUM = "nofcen" Case Is = 1000 XNumeroLUM = "mila" Case Is = 2000 XNumeroLUM = "mila" Case Is = 1000000 XNumeroLUM = "unmigliun" Case Is = 2000000 XNumeroLUM = "migliuni" Case Is = 1000000000 XNumeroLUM = "unmigliard" Case Is = 2000000000 XNumeroLUM = "migliard" End Select End Function