Bonsoir
Je sollicite votre aide suite à des soucis dans un formulaire personnalisé :
tout fonctionne sauf un bouton "modifié"
j'ai vérifié la concordance des cellules aux colonnes, pas d'erreurs.
Je vous joint le code en espérant que quelqu'un puisse résoudre mon problème: il s'agit du code de bouton "intégrer" et du bouton "modifier"
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154 Private Sub CommandButton1_Click() Dim L As Integer If MsgBox("Confirmez-vous l'insertion de cette nouvelle affaire ?", vbYesNo, "Demande de confirmation d'ajout") = vbYes Then 'Pour placer le nouvel enregistrement à la première ligne de tableau non vide L = Sheets("Suivi").Range("A65536").End(xlUp).Row + 1 Range("A" & L).Value = ComboBox1 Range("B" & L).Value = TextBox2 Range("C" & L).Value = TextBox5 Range("D" & L).Value = TextBox3 Range("E" & L).Value = TexBox6 Range("F" & L).Value = TextBox4 Range("G" & L).Value = TextBox54 Range("H" & L).Value = TextBox8 Range("I" & L).Value = ComboBox2 Range("J" & L).Value = ComboBox3 Range("K" & L).Value = TextBox11 Range("L" & L).Value = ComboBox4 Range("M" & L).Value = TextBox13 Range("N" & L).Value = TextBox14 Range("Q" & L).Value = TextBox15 Range("S" & L).Value = TextBox53 Range("T" & L).Value = TextBox16 Range("U" & L).Value = TextBox17 Range("V" & L).Value = TextBox18 Range("W" & L).Value = TextBox19 Range("X" & L).Value = TextBox20 Range("Y" & L).Value = TextBox21 Range("Z" & L).Value = TextBox22 Range("AA" & L).Value = TextBox23 Range("AB" & L).Value = TextBox24 Range("AC" & L).Value = TextBox25 Range("AE" & L).Value = TextBox26 Range("AF" & L).Value = TextBox27 Range("AG" & L).Value = TextBox28 Range("AI" & L).Value = TextBox29 Range("AM" & L).Value = TextBox30 Range("AN" & L).Value = TextBox31 Range("AS" & L).Value = TextBox32 Range("AT" & L).Value = TextBox33 Range("AX" & L).Value = TextBox34 Range("AY" & L).Value = TextBox35 Range("AZ" & L).Value = TextBox36 Range("BA" & L).Value = TextBox37 Range("BB" & L).Value = TextBox38 Range("BC" & L).Value = TextBox39 Range("BG" & L).Value = TextBox40 Range("BH" & L).Value = TextBox41 Range("BI" & L).Value = TextBox42 Range("BJ" & L).Value = TextBox43 Range("BK" & L).Value = TextBox44 Range("BM" & L).Value = TextBox45 Range("BN" & L).Value = TextBox46 Range("BO" & L).Value = TextBox47 Range("BP" & L).Value = TextBox48 Range("BQ" & L).Value = TextBox49 Range("BU" & L).Value = TextBox56 Range("BV" & L).Value = TextBox50 Range("BW" & L).Value = TextBox51 Range("BX" & L).Value = TextBox52 Unload Me End If End Sub Private Sub CommandButton2_Click() Dim lRow As Long, lCol As Long Dim i As Integer Worksheets("Suivi").Activate If MsgBox(" Confirmez-vous la modification de cette affaire ? ", vbYesNo, " Demande de confirmation de modification ") = vbYes Then If Me.ComboBox6.ListIndex = -1 Then Exit Sub lRow = Range("G" & Rows.Count).End(xlUp).Row lCol = Cells(lRow, Columns.Count).End(xlToLeft).Column Set result = Range("G2:G" & Range("G" & Rows.Count).End(xlUp).Row).Find(what:=ComboBox6.Text, LookAt:=xlWhole) If Not result Is Nothing Then Range("A" & result.Row).Value = ComboBox1 Range("B" & result.Row).Value = TextBox2 Range("C" & result.Row).Value = TextBox5 Range("D" & result.Row).Value = TextBox3 Range("E" & result.Row).Value = TexBox6 Range("F" & result.Row).Value = TextBox4 Range("G" & result.Row).Value = TextBox54 Range("H" & result.Row).Value = TextBox8 Range("I" & result.Row).Value = ComboBox2 Range("J" & result.Row).Value = ComboBox3 Range("K" & result.Row).Value = TextBox11 Range("L" & result.Row).Value = ComboBox4 Range("M" & result.Row).Value = TextBox13 Range("N" & result.Row).Value = TextBox14 Range("Q" & result.Row).Value = TextBox15 Range("S" & result.Row).Value = TextBox53 Range("T" & result.Row).Value = TextBox16 Range("U" & result.Row).Value = TextBox17 Range("V" & result.Row).Value = TextBox18 Range("W" & result.Row).Value = TextBox19 Range("X" & result.Row).Value = TextBox20 Range("Y" & result.Row).Value = TextBox21 Range("Z" & result.Row).Value = TextBox22 Range("AA" & result.Row).Value = TextBox23 Range("AB" & result.Row).Value = TextBox24 Range("AC" & result.Row).Value = TextBox25 Range("AE" & result.Row).Value = TextBox26 Range("AF" & result.Row).Value = TextBox27 Range("AG" & result.Row).Value = TextBox28 Range("AI" & result.Row).Value = TextBox29 Range("AM" & result.Row).Value = TextBox30 Range("AN" & result.Row).Value = TextBox31 Range("AS" & result.Row).Value = TextBox32 Range("AT" & result.Row).Value = TextBox33 Range("AX" & result.Row).Value = TextBox34 Range("AY" & result.Row).Value = TextBox35 Range("AZ" & result.Row).Value = TextBox36 Range("BA" & result.Row).Value = TextBox37 Range("BB" & result.Row).Value = TextBox38 Range("BC" & result.Row).Value = TextBox39 Range("BG" & result.Row).Value = TextBox40 Range("BH" & result.Row).Value = TextBox41 Range("BI" & result.Row).Value = TextBox42 Range("BJ" & result.Row).Value = TextBox43 Range("BK" & result.Row).Value = TextBox44 Range("BM" & result.Row).Value = TextBox45 Range("BN" & result.Row).Value = TextBox46 Range("BO" & result.Row).Value = TextBox47 Range("BP" & result.Row).Value = TextBox48 Range("BQ" & result.Row).Value = TextBox49 Range("BU" & result.Row).Value = TextBox56 Range("BV" & result.Row).Value = TextBox50 Range("BW" & result.Row).Value = TextBox51 Range("BX" & result.Row).Value = TextBox52 Unload Me Else MsgBox "Error!" End If End If End Sub
Partager