Problème de format dans les tex box

Squoltahthx94

XLDnaute Occasionnel
Bonsoir le Forum,

Je cherche à rapporté un résultat en pourcentage par le code suivant :
Code:
Private Sub CommandButton53_Click()
TextBox121.Value = ((CDbl(TextBox101) - (CDbl(TextBox2) * CDbl(TextBox95)) + (CDbl(TextBox7) * CDbl(TextBox94))) / CDbl(TextBox101))
...format % voir plus bas
end sub
j'ai essayé les formats suivant :

TextBox121.Value = Format(TextBox117.Value, "# ###.00%")
ou
TextBox121 = Format(pourcent, "0,00 %")essais pourcentage
ou
Me.TextBox121.Value = Format(Me.TextBox121.Value, "0.00%")

j'obtiens 1 ou 100 % mai jamais 15 % ou 25,3 %

si textbox 2 : 50 , tetxbox95 = 2 idem pour textbox 94 et textbox 7 et textbox101 = 400 je devrais obtenir 50 % mais j'ai 100% ou 1 quelque soit le format que j'emploie.

Merci de votre aide

je vous laisse mon fichier à tous hasard, il s'agit du bouton 'marge' et il faut appuyer sur les bouton calcul sur le cote gauche (les 3) pour que lma textbox101 soit alimenté

Merci de votre retour
 

Pièces jointes

  • Devis+matrice v4.2 beta.xlsm
    378.9 KB · Affichages: 116

kjin

XLDnaute Barbatruc
Re : Problème de format dans les tex box

Bonsoir,
Pas vu le fichier alors peut-être
Code:
x = ((CDbl(TextBox101) - (CDbl(TextBox2) * CDbl(TextBox95)) + (CDbl(TextBox7) * CDbl(TextBox94))) / CDbl(TextBox101))
TextBox121.Value = FormatPercent(x / 100, 2)
A+
kjin
 

Discussions similaires

Statistiques des forums

Discussions
312 213
Messages
2 086 302
Membres
103 174
dernier inscrit
OBUTT