Private Sub CmdSupTous_Click()
Dim lig&, ligne&, derlig&, i&, k&, j&, n&, x&, rw&
On Error Resume Next
With WsProd
derlig = .Cells(.Rows.Count, 4).End(xlUp).Row
For x = derlig To 2 Step -1
If .Cells(x, 4) = CmbCategories Then .Cells(x, 1).EntireRow.Delete
Next x
ligne = .Range("a65536").End(xlUp).Row
For k = 2 To ligne
If .Cells(k, 2) <> "" Then .Cells(k, 1) = k - 1
Next k
End With
With WsStock
derlig = .Cells(.Rows.Count, 4).End(xlUp).Row
For x = derlig To 2 Step -1
If .Cells(x, 4) = CmbCategories Then .Cells(x, 1).EntireRow.Delete
Next x
.Rows.RowHeight = 12.75
ligne = .Range("a65536").End(xlUp).Row
For k = 2 To ligne
If .Cells(k, 2) <> "" Then .Cells(k, 1) = k - 1
Next k
End With
With WsCat
derlig = .Cells(.Rows.Count, 2).End(xlUp).Row
For x = derlig To 2 Step -1
If .Cells(x, 2) = CmbCategories Then .Cells(x, 1).EntireRow.Delete
Next x
ligne = .Range("a65536").End(xlUp).Row
For k = 2 To ligne
If .Cells(k, 2) <> "" Then .Cells(k, 1) = k - 1
Next k
End With
With WsLC
derlig = .Cells(.Rows.Count, 4).End(xlUp).Row
For x = derlig To 2 Step -1
If .Cells(x, 3) = CmbCategories Then .Cells(x, 1).EntireRow.Delete
Next x
ligne = .Range("a65536").End(xlUp).Row
For k = 2 To ligne
If .Cells(k, 2) <> "" Then: .Cells(k, 1) = k - 1
Next k
End With
Application.Wait (Now + TimeValue("00:00:01"))
Call ChangeCode
WsProd.Range("a2:d65536").Copy WsStock.Range("a2")
ListView1.ListItems.Clear
For n = 2 To 7
Controls("TextBox" & n) = ""
Next n
End Sub