Problème Format textbox %

annov

XLDnaute Occasionnel
Bonsoir ,

J'ai un petit probléme avec le format d'une textbox dans une userform .

Le format de ma cellule est en % donc lorsque je saisi 50=> 50%
Je devrais retrouver la valeur avec le même format dans ma texbox mais elle affiche : 0.5 . au lieu d'afficher 50%.


Pourriez vous m'indiquer s'il y a une erreur sur la ligne ci dessous .

UserForm1.TextBox2.Value = ActiveCell.Value=Format(###%)


Merci
 

annov

XLDnaute Occasionnel
Re : Problème Format textbox %

Bonsoir, Dranreb

'ai testé mais il me renvoie True ou False ? Ci dessous le code complet car tout à l'heure j'avais oublié.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Test1, Test2
Test1 = ActiveCell.Column - 1
Test2 = ActiveCell.Row - 6
If Not Application.Intersect(Target, Range("a6:cm58")) Is Nothing Then
Range("a6:cm58").Interior.ColorIndex = xlNone
Range(ActiveCell.Address, ActiveCell.Offset(0, -Test1).Address).Interior.ColorIndex = 6
Range(ActiveCell.Address, ActiveCell.Offset(-Test2, 0).Address).Interior.ColorIndex = 6
ActiveCell.Offset(0, -Test1).Interior.ColorIndex = 7
ActiveCell.Offset(-Test2, 0).Interior.ColorIndex = 7
ActiveCell.Interior.ColorIndex = 7

Range("O3") = ActiveCell.Address(0, 0)
Range("P3") = ActiveCell.Value
Range("Q3") = ActiveCell.Offset(-Test2, 0).Value
Range("R3") = ActiveCell.Offset(0, -Test1).Value

UserForm1.TextBox1.Value = ActiveCell.Address(0, 0)
UserForm1.TextBox2.Value = ActiveCell.Value = Format(ActiveCell.Value, "###%")
UserForm1.TextBox3.Value = ActiveCell.Offset(-Test2, 0).Value
UserForm1.TextBox4.Value = ActiveCell.Offset(0, -Test1).Value
End If
End Sub


@+
 

Bebere

XLDnaute Barbatruc
Re : Problème Format textbox %

bonjour´Annov,Dranreb
si cellule formatée en
UserForm1.TextBox2.Value = ActiveCell.Text
'partie colorée à enlever
UserForm1.TextBox2.Value = ActiveCell.Value = Format(ActiveCell.Value, "###%")
 

Discussions similaires

Réponses
5
Affichages
131

Statistiques des forums

Discussions
312 240
Messages
2 086 518
Membres
103 241
dernier inscrit
Peyo33