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
| Sub rassembler()
Dim dercol As Long
Dim F As Worksheet
Dim C As Integer
Dim derlig As Long
Dim L As Long
Dim lig As Long
Application.ScreenUpdating = False
L = 2
Set F = Sheets("Feuil2")
dercol = F.Cells(1, F.Cells.Columns.Count).End(xlToLeft).Column
For C = 1 To dercol
If F.Cells(1, C) = "AUTRE MATERIEL DEJA RENSEIGNE ?" Then
derlig = F.Cells(Rows.Count, C).End(xlUp).Row
F.Range(Cells(2, C), Cells(derlig, C)).Copy
F.Cells(L, "H").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
True, Transpose:=False
L = F.Cells(Rows.Count, 8).End(xlUp).Row + 1
End If
Next C
Dim X As Long
Dim ligH As Long
ligH = F.Cells(Rows.Count, "H").End(xlUp).Row
For X = ligH To 2 Step -1
If Cells(X, "H").Value = "" Then Cells(X, "H").Delete xlUp
Next X
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub |
Partager