M
marion
Guest
Bonsoir au forum.
un prolème avec le format d'un nombre.
J'ai un userform qui apparait lorsque je me possitionne sur les cellule de la colonne B, il me donne des information qui sont positionnées un peu plus loin.
mon soucis et que je n'arrive pas a avoir des nombres entiers, il me donne des chiffres avec toutes les décimales. voici le code de l'userform:
si une personne peu me donner un petit coup de main merci d'avance.
A+ Marion
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Range("B5:B" & Range("B65536").End(xlUp).Row), Range(Target.Address)) Is Nothing Then
Load UserForm1
With UserForm1
Selection.NumberFormat = "0"
.ListBox1.AddItem
.ListBox1.List(0, 0) = Range("CA4")
.ListBox1.List(0, 1) = Range("CA" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(1, 0) = Range("BZ4")
.ListBox1.List(1, 1) = Range("BZ" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(2, 0) = Range("ga4")
.ListBox1.List(2, 1) = Range("ga" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(3, 0) = Range("gb4")
.ListBox1.List(3, 1) = Range("gb" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(4, 0) = Range("gC4")
.ListBox1.List(4, 1) = Range("gC" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(5, 0) = Range("gD4")
.ListBox1.List(5, 1) = Range("gD" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(6, 0) = Range("gE4")
.ListBox1.List(6, 1) = Range("gE" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(7, 0) = Range("gF4")
.ListBox1.List(7, 1) = Range("gF" & Range(Target.Address).Row)
.Show
End With
End If
End Sub
un prolème avec le format d'un nombre.
J'ai un userform qui apparait lorsque je me possitionne sur les cellule de la colonne B, il me donne des information qui sont positionnées un peu plus loin.
mon soucis et que je n'arrive pas a avoir des nombres entiers, il me donne des chiffres avec toutes les décimales. voici le code de l'userform:
si une personne peu me donner un petit coup de main merci d'avance.
A+ Marion
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Range("B5:B" & Range("B65536").End(xlUp).Row), Range(Target.Address)) Is Nothing Then
Load UserForm1
With UserForm1
Selection.NumberFormat = "0"
.ListBox1.AddItem
.ListBox1.List(0, 0) = Range("CA4")
.ListBox1.List(0, 1) = Range("CA" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(1, 0) = Range("BZ4")
.ListBox1.List(1, 1) = Range("BZ" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(2, 0) = Range("ga4")
.ListBox1.List(2, 1) = Range("ga" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(3, 0) = Range("gb4")
.ListBox1.List(3, 1) = Range("gb" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(4, 0) = Range("gC4")
.ListBox1.List(4, 1) = Range("gC" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(5, 0) = Range("gD4")
.ListBox1.List(5, 1) = Range("gD" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(6, 0) = Range("gE4")
.ListBox1.List(6, 1) = Range("gE" & Range(Target.Address).Row)
.ListBox1.AddItem
.ListBox1.List(7, 0) = Range("gF4")
.ListBox1.List(7, 1) = Range("gF" & Range(Target.Address).Row)
.Show
End With
End If
End Sub