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
| """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Sub recup()
Dim debut, ligne As Integer
Dim liste, valeur As Variant
Dim trouve As Boolean
liste = Array(shDE_LIB, shAR_DE, shAR_LIB)
Application.ScreenUpdating = False
Range("A6").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.ClearContents
ligne = Range("a49901").End(xlUp).Row + 1
For i = 1 To ThisWorkbook.Sheets.Count
trouve = False
For Each valeur In liste
pos = InStr(ThisWorkbook.Sheets(i).Name, valeur)
If pos > 0 Then
trouve = True
End If
Exit For
If trouve Then
Sheets(i).Select
debut = 0
For j = 1 To Range("b49901").End(xlUp).Row
If Cells(j, 2) = "Libellé" Then
debut = j + 1
End If
Next j
fin = Sheets(i).Range("c49901").End(xlUp).Row - 1
Range(Cells(debut, 1), Cells(fin, 3)).Copy
Sheets("ABC").Select
Cells(ligne, 1).Select
ActiveSheet.Paste
ligne = Range("A49901").End(xlUp).Row + 1
Next i '"""""""""""je bloque à ce niveau """""""""""""
'l'erreur c'est d'ajouter un autre next alors que celui là est suffisant
[A1].Select
Application.ScreenUpdating = True
End Sub
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
Partager