Bonsoir,
Je me permet de venir vers vous, car je souhaiterais modifier les cellules récupérer dans un autre formulaire selon un listbox et différents textbox.
Voici le code actuel qu'y ne faire rien.
Merci d'avance pour vos réponses.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 Sub modifier() nni = Sheets("feuil1").Range("A" & i).Value equipe = Sheets("feuil1").Range("B" & i).Value If nni = UserForm3.TextBox1.Value And equipe = UserForm3.TextBox2.Value Then nni = UserForm3.TextBox1.Value equipe = UserForm3.TextBox2.Value End If UserForm3.Hide End Sub
Cordialement,
Vincent
Re bonsoir,
Je vais vous donner des essais avec l'ensemble de mon code. Ce que je souhaiterais c'est que listindex sélectionné ce modifie avec les valeur des textbox du userform3
Merci d'avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 Private Sub CommandButton1_Click() Dim CHOIX CHOIX = TextBox1.Value 'Effacer la liste LISTE ListBox1.Clear 'Remplir le tableau LISTE après filtrage For I = 2 To 20 If Range("A" & I).Value = CHOIX Then Me.ListBox1.AddItem (Range(" B" & I)) Me.ListBox1.List(ListBox1.ListCount - 1, 0) = Range("A" & I) Me.ListBox1.List(ListBox1.ListCount - 1, 1) = Range("B" & I) Me.ListBox1.List(ListBox1.ListCount - 1, 2) = Range("C" & I) End If Next I End Sub Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean) If Me.ListBox1.ListIndex > -1 Then Me.Tag = Me.ListBox1.ListIndex UserForm3.TextBox1 = Me.ListBox1.List(Me.ListBox1.ListIndex, 0) UserForm3.TextBox2 = Me.ListBox1.List(Me.ListBox1.ListIndex, 1) UserForm3.TextBox3 = Me.ListBox1.List(Me.ListBox1.ListIndex, 2) UserForm3.Show End If End Sub Sub modifier() For I = 1 To 20 k = Sheets("feuil1").Range("A" & I).Value j = Sheets("feuil1").Range("B" & I).Value If k = Me.ListBox1.List(Me.ListBox1.ListIndex, 0) And j = Me.ListBox1.List(Me.ListBox1.ListIndex, 1) Then k = UserForm3.TextBox1.Value j = UserForm3.TextBox2.Value End If Next I UserForm3.Hide End Sub
Cordialement,
vincent
Partager