Bjr!
Concernant mon application de gestion parc machine j'ai un autre pb:
je veux savoir comment deplacer une ligne d'une feuille à l'autre:
j'ai arrive à faire copier la ligne d'une feuille et la coller sur une autre mais la mon besoin c'est de la deplacer complement: la faire disparaitre d'une feuille et la mettre dans une autre feuille :
Mon code est: j'effectue la recherché de la machine pour m'assurer de ses données ensuite en cliquant sur un boutton je la déplace d'une feuille source à une feuille de distination!
et maerci 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
 
Option Explicit
Function IsRefExist(rng As Range, ref As String) As Boolean
 IsRefExist = Application.CountIf(rng, ref) = 0
End Function
Private Sub CommandButton10_Click()
Sheets("ST").Activate
    Dim derligne As Integer
        If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
        derligne = Sheets("ST").Range("A10000").End(xlUp).Row + 1
            Cells(derligne, 1) = TextBox35.Value
            Cells(derligne, 2) = TextBox36.Value
            Cells(derligne, 3) = TextBox37.Value
            Cells(derligne, 4) = TextBox38.Value
            Cells(derligne, 5) = TextBox39.Value
            Cells(derligne, 6) = TextBox40.Value
            Cells(derligne, 7) = TextBox41.Value
            Cells(derligne, 8) = TextBox42.Value
            Cells(derligne, 9) = TextBox43.Value
            Cells(derligne, 10) = TextBox44.Value
            Cells(derligne, 11) = TextBox45.Value
            Cells(derligne, 12) = TextBox46.Value
            Cells(derligne, 13) = TextBox47.Value
            Cells(derligne, 14) = TextBox48.Value
            Cells(derligne, 15) = TextBox49.Value
            Cells(derligne, 16) = TextBox50.Value
    End If
    Unload Me
    SoumissionDesMachines.Show
End Sub
Private Sub CommandButton15_Click()
Sheets("SZ").Activate
    Dim derligne As Integer
        If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
        derligne = Sheets("SZ").Range("A10000").End(xlUp).Row + 1
            Cells(derligne, 1) = TextBox35.Value
            Cells(derligne, 2) = TextBox36.Value
            Cells(derligne, 3) = TextBox37.Value
            Cells(derligne, 4) = TextBox38.Value
            Cells(derligne, 5) = TextBox39.Value
            Cells(derligne, 6) = TextBox40.Value
            Cells(derligne, 7) = TextBox41.Value
            Cells(derligne, 8) = TextBox42.Value
            Cells(derligne, 9) = TextBox43.Value
            Cells(derligne, 10) = TextBox44.Value
            Cells(derligne, 11) = TextBox45.Value
            Cells(derligne, 12) = TextBox46.Value
            Cells(derligne, 13) = TextBox47.Value
            Cells(derligne, 14) = TextBox48.Value
            Cells(derligne, 15) = TextBox49.Value
            Cells(derligne, 16) = TextBox50.Value
    End If
    Unload Me
    SoumissionDesMachines.Show
End Sub
Private Sub CommandButton16_Click()
Sheets("TUNICO").Activate
    Dim derligne As Integer
        If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
        derligne = Sheets("TUNICO").Range("A10000").End(xlUp).Row + 1
            Cells(derligne, 1) = TextBox35.Value
            Cells(derligne, 2) = TextBox36.Value
            Cells(derligne, 3) = TextBox37.Value
            Cells(derligne, 4) = TextBox38.Value
            Cells(derligne, 5) = TextBox39.Value
            Cells(derligne, 6) = TextBox40.Value
            Cells(derligne, 7) = TextBox41.Value
            Cells(derligne, 8) = TextBox42.Value
            Cells(derligne, 9) = TextBox43.Value
            Cells(derligne, 10) = TextBox44.Value
            Cells(derligne, 11) = TextBox45.Value
            Cells(derligne, 12) = TextBox46.Value
            Cells(derligne, 13) = TextBox47.Value
            Cells(derligne, 14) = TextBox48.Value
            Cells(derligne, 15) = TextBox49.Value
            Cells(derligne, 16) = TextBox50.Value
    End If
    Unload Me
    SoumissionDesMachines.Show
End Sub
Private Sub CommandButton14_Click()
Sheets("FACTORY").Activate
    Dim derligne As Integer
        If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
        derligne = Sheets("FACTORY").Range("A10000").End(xlUp).Row + 1
            Cells(derligne, 1) = TextBox35.Value
            Cells(derligne, 2) = TextBox36.Value
            Cells(derligne, 3) = TextBox37.Value
            Cells(derligne, 4) = TextBox38.Value
            Cells(derligne, 5) = TextBox39.Value
            Cells(derligne, 6) = TextBox40.Value
            Cells(derligne, 7) = TextBox41.Value
            Cells(derligne, 8) = TextBox42.Value
            Cells(derligne, 9) = TextBox43.Value
            Cells(derligne, 10) = TextBox44.Value
            Cells(derligne, 11) = TextBox45.Value
            Cells(derligne, 12) = TextBox46.Value
            Cells(derligne, 13) = TextBox47.Value
            Cells(derligne, 14) = TextBox48.Value
            Cells(derligne, 15) = TextBox49.Value
            Cells(derligne, 16) = TextBox50.Value
    End If
    Unload Me
    SoumissionDesMachines.Show
End Sub
Private Sub CommandButton17_Click()
Sheets("BELGIQUE").Activate
    Dim derligne As Integer
        If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
        derligne = Sheets("BELGIQUE").Range("A10000").End(xlUp).Row + 1
            Cells(derligne, 1) = TextBox35.Value
            Cells(derligne, 2) = TextBox36.Value
            Cells(derligne, 3) = TextBox37.Value
            Cells(derligne, 4) = TextBox38.Value
            Cells(derligne, 5) = TextBox39.Value
            Cells(derligne, 6) = TextBox40.Value
            Cells(derligne, 7) = TextBox41.Value
            Cells(derligne, 8) = TextBox42.Value
            Cells(derligne, 9) = TextBox43.Value
            Cells(derligne, 10) = TextBox44.Value
            Cells(derligne, 11) = TextBox45.Value
            Cells(derligne, 12) = TextBox46.Value
            Cells(derligne, 13) = TextBox47.Value
            Cells(derligne, 14) = TextBox48.Value
            Cells(derligne, 15) = TextBox49.Value
            Cells(derligne, 16) = TextBox50.Value
    End If
    Unload Me
    SoumissionDesMachines.Show
End Sub
Private Sub CommandButton18_Click()
Sheets("Machines").Activate
    If ComboBox8.ListIndex < 0 Then
         MsgBox "Vous devez taper le Numéro de série fabriquant"
         End If
    Dim Machines As Worksheet
    Dim no_ligne As Integer
    no_ligne = ComboBox8.ListIndex + 2
        TextBox35.Value = Cells(no_ligne, 1).Value
        TextBox36.Value = Cells(no_ligne, 2).Value
        TextBox37.Value = Cells(no_ligne, 3).Value
        TextBox38.Value = Cells(no_ligne, 4).Value
        TextBox39.Value = Cells(no_ligne, 5).Value
        TextBox40.Value = Cells(no_ligne, 6).Value
        TextBox41.Value = Cells(no_ligne, 7).Value
        TextBox42.Value = Cells(no_ligne, 8).Value
        TextBox43.Value = Cells(no_ligne, 9).Value
        TextBox44.Value = Cells(no_ligne, 10).Value
        TextBox45.Value = Cells(no_ligne, 11).Value
        TextBox46.Value = Cells(no_ligne, 12).Value
        TextBox47.Value = Cells(no_ligne, 13).Value
        TextBox48.Value = Cells(no_ligne, 14).Value
        TextBox49.Value = Cells(no_ligne, 15).Value
        TextBox50.Value = Cells(no_ligne, 16).Value
End Sub
Private Sub CommandButton19_Click()
Sheets("Machines").Activate
    If ComboBox6.ListIndex < 0 Then
         MsgBox "Vous devez taper la Nouvelle Réf Interne"
     End If
    Dim Machines As Worksheet
    Dim no_ligne As Integer
    no_ligne = ComboBox6.ListIndex + 2
        TextBox35.Value = Cells(no_ligne, 1).Value
        TextBox36.Value = Cells(no_ligne, 2).Value
        TextBox37.Value = Cells(no_ligne, 3).Value
        TextBox38.Value = Cells(no_ligne, 4).Value
        TextBox39.Value = Cells(no_ligne, 5).Value
        TextBox40.Value = Cells(no_ligne, 6).Value
        TextBox41.Value = Cells(no_ligne, 7).Value
        TextBox42.Value = Cells(no_ligne, 8).Value
        TextBox43.Value = Cells(no_ligne, 9).Value
        TextBox44.Value = Cells(no_ligne, 10).Value
        TextBox45.Value = Cells(no_ligne, 11).Value
        TextBox46.Value = Cells(no_ligne, 12).Value
        TextBox47.Value = Cells(no_ligne, 13).Value
        TextBox48.Value = Cells(no_ligne, 14).Value
        TextBox49.Value = Cells(no_ligne, 15).Value
        TextBox50.Value = Cells(no_ligne, 16).Value
End Sub
Private Sub CommandButton20_Click()
    TextBox35 = ""       'Vider le continue du TextBox'
    TextBox36 = ""
    TextBox37 = ""
    TextBox38 = ""
    TextBox39 = ""
    TextBox40 = ""
    TextBox41 = ""
    TextBox42 = ""
    TextBox43 = ""
    TextBox44 = ""
    TextBox45 = ""
    TextBox46 = ""
    TextBox47 = ""
    TextBox48 = ""
    TextBox49 = ""
    TextBox50 = ""
        ComboBox5.Value = ""       'Vider le continue du ComboBox'
        ComboBox6.Value = ""
        ComboBox8.Value = ""
End Sub
Private Sub CommandButton9_Click()
    Sheets("Machines").Activate
    If ComboBox5.ListIndex < 0 Then
         MsgBox "Vous devez taper l'Ancienne Réf Interne"
        End If
    Dim Machines As Worksheet
    Dim no_ligne As Integer
    no_ligne = ComboBox5.ListIndex + 2
        TextBox35.Value = Cells(no_ligne, 1).Value
        TextBox36.Value = Cells(no_ligne, 2).Value
        TextBox37.Value = Cells(no_ligne, 3).Value
        TextBox38.Value = Cells(no_ligne, 4).Value
        TextBox39.Value = Cells(no_ligne, 5).Value
        TextBox40.Value = Cells(no_ligne, 6).Value
        TextBox41.Value = Cells(no_ligne, 7).Value
        TextBox42.Value = Cells(no_ligne, 8).Value
        TextBox43.Value = Cells(no_ligne, 9).Value
        TextBox44.Value = Cells(no_ligne, 10).Value
        TextBox45.Value = Cells(no_ligne, 11).Value
        TextBox46.Value = Cells(no_ligne, 12).Value
        TextBox47.Value = Cells(no_ligne, 13).Value
        TextBox48.Value = Cells(no_ligne, 14).Value
        TextBox49.Value = Cells(no_ligne, 15).Value
        TextBox50.Value = Cells(no_ligne, 16).Value
End Sub
Private Sub CommandButton12_Click()
    Unload SoumissionDesMachines
    MenuPrincipale.Show
End Sub
Private Sub ComboBox5_Change()
Sheets("Machines").Activate
If IsRefExist(Range("A:A"), ComboBox5) Then
  MsgBox "Ancienne Réf Interne Introuvable"
  ComboBox5.Value = ""
 End If
End Sub
Private Sub ComboBox6_Change()
Sheets("Machines").Activate
If IsRefExist(Range("B:B"), ComboBox6) Then
  MsgBox "Ancienne Réf Interne Introuvable"
  ComboBox6.Value = ""
 End If
End Sub
Private Sub ComboBox8_Change()
Sheets("Machines").Activate
If IsRefExist(Range("C:C"), ComboBox8) Then
  MsgBox "Ancienne Réf Interne Introuvable"
  ComboBox8.Value = ""
 End If
End Sub