A voir également:
- Access
- Access appdata - Guide
- Exemple base de données access à télécharger gratuit ✓ - Forum Logiciels
- You don't have permission to access this resource ✓ - Forum Réseaux sociaux
- Acer quick access - Forum Logiciels
- Controller access network - Télécharger - Contrôle parental
2 réponses
soleil_levant
Messages postés
393
Date d'inscription
lundi 15 septembre 2008
Statut
Membre
Dernière intervention
14 avril 2011
32
19 mars 2009 à 01:04
19 mars 2009 à 01:04
Salut,
D'abord tu commet trop d'erreur de français! lol, ensuite faut vraiment connaitre le bé à bas de MS Office : les modules VBA !!
Renseigne toi dessus et tu verras. A voir ton post difficile de te répondre
D'abord tu commet trop d'erreur de français! lol, ensuite faut vraiment connaitre le bé à bas de MS Office : les modules VBA !!
Renseigne toi dessus et tu verras. A voir ton post difficile de te répondre
soleil_levant
Messages postés
393
Date d'inscription
lundi 15 septembre 2008
Statut
Membre
Dernière intervention
14 avril 2011
32
19 mars 2009 à 01:05
19 mars 2009 à 01:05
Sinon peux-tu faire un coller de ton code et on te diras quoi modifier!!
Option Compare Database
Public Function sommelettre(ByVal argument As Currency) As String
Dim entier As Double
Dim cts As Double
Dim resultat1 As String
Dim resultat2 As String
entier = Int(argument) ' Valeur entière
cts = (argument - entier) * 100 ' Valeur Centimes
resultat1 = somlet2(entier)
resultat2 = somlet2(cts)
If Trim(resultat1) <> "" Then
resultat1 = resultat1 & " Dinars "
End If
If Trim(resultat2) <> "" Then
resultat2 = resultat2 & " Cts"
End If
sommelettre = resultat1 & " et " & resultat2
End Function
'*************************************************************
' Fonction de conversion chiffres en lettres
'*************************************************************
Public Function somlet2(ByVal argument As Double) As String
Dim lettres As Variant
Dim unites As Variant
Dim dizaines As Variant
Dim centaines As Variant
Dim unite As Integer
Dim dix As Integer
Dim cent As Integer
Dim groupes As Variant
Dim chaine As String
Dim ng, nc As Integer
Dim i, j, k As Integer
Dim xx As String
chaine = Trim(Str(argument))
nc = Len(chaine) ' Nbre de chiffres
lettres = Array("", "mille", "million", "milliard", "billion")
unites = Array("", "un", "deux", "trois", "quatre", "cinq", "six", "sept", "huit", "neuf", "dix", "onze", "douze", "treize", "quatorze", "quinze", "seize", "dix sept", "dix huit", "dix neuf")
dizaines = Array("", "dix", "vingt", "trente", "quarante", "cinquante", "soixante", "soixante dix", "quatre vingt", "quatre vingt dix")
centaines = Array("", "cent", "deux cents", "trois cents", "quatre cents", "cinq cents", "six cents", "sept cents", "huit cents", "neuf cents")
If argument = 0 Then
somlet2 = ""
Else
If nc Mod 3 > 0 Then
ng = Int(nc / 3) + 1 ' Nbre de groupes
Else
ng = nc / 3
End If
ReDim groupes(ng - 1)
chaine = String(ng * 3 - nc, " ") & chaine
nc = Len(chaine)
j = 0
For i = nc To 1 Step -3
xx = Mid(chaine, i - 2, i)
groupes(j) = xx
j = j + 1
Next
chaine = ""
For j = 0 To UBound(groupes)
unite = Val(Mid(groupes(j), 3, 1))
dix = Val(Mid(groupes(j), 2, 1))
If dix = 1 Or dix = 7 Or dix = 9 Then
dix = dix - 1
unite = unite + 10
End If
cent = Val(Mid(groupes(j), 1, 1))
chaine = centaines(cent) & " " & dizaines(dix) & " " & unites(unite) & " " & lettres(j) & " " & chaine
Next
somlet2 = chaine
End If
End Function
Public Function sommelettre(ByVal argument As Currency) As String
Dim entier As Double
Dim cts As Double
Dim resultat1 As String
Dim resultat2 As String
entier = Int(argument) ' Valeur entière
cts = (argument - entier) * 100 ' Valeur Centimes
resultat1 = somlet2(entier)
resultat2 = somlet2(cts)
If Trim(resultat1) <> "" Then
resultat1 = resultat1 & " Dinars "
End If
If Trim(resultat2) <> "" Then
resultat2 = resultat2 & " Cts"
End If
sommelettre = resultat1 & " et " & resultat2
End Function
'*************************************************************
' Fonction de conversion chiffres en lettres
'*************************************************************
Public Function somlet2(ByVal argument As Double) As String
Dim lettres As Variant
Dim unites As Variant
Dim dizaines As Variant
Dim centaines As Variant
Dim unite As Integer
Dim dix As Integer
Dim cent As Integer
Dim groupes As Variant
Dim chaine As String
Dim ng, nc As Integer
Dim i, j, k As Integer
Dim xx As String
chaine = Trim(Str(argument))
nc = Len(chaine) ' Nbre de chiffres
lettres = Array("", "mille", "million", "milliard", "billion")
unites = Array("", "un", "deux", "trois", "quatre", "cinq", "six", "sept", "huit", "neuf", "dix", "onze", "douze", "treize", "quatorze", "quinze", "seize", "dix sept", "dix huit", "dix neuf")
dizaines = Array("", "dix", "vingt", "trente", "quarante", "cinquante", "soixante", "soixante dix", "quatre vingt", "quatre vingt dix")
centaines = Array("", "cent", "deux cents", "trois cents", "quatre cents", "cinq cents", "six cents", "sept cents", "huit cents", "neuf cents")
If argument = 0 Then
somlet2 = ""
Else
If nc Mod 3 > 0 Then
ng = Int(nc / 3) + 1 ' Nbre de groupes
Else
ng = nc / 3
End If
ReDim groupes(ng - 1)
chaine = String(ng * 3 - nc, " ") & chaine
nc = Len(chaine)
j = 0
For i = nc To 1 Step -3
xx = Mid(chaine, i - 2, i)
groupes(j) = xx
j = j + 1
Next
chaine = ""
For j = 0 To UBound(groupes)
unite = Val(Mid(groupes(j), 3, 1))
dix = Val(Mid(groupes(j), 2, 1))
If dix = 1 Or dix = 7 Or dix = 9 Then
dix = dix - 1
unite = unite + 10
End If
cent = Val(Mid(groupes(j), 1, 1))
chaine = centaines(cent) & " " & dizaines(dix) & " " & unites(unite) & " " & lettres(j) & " " & chaine
Next
somlet2 = chaine
End If
End Function