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
| Sub TestC()
' Ramener contenu de C
Dim VA, i&, L&
DL = Cells(Rows.Count, 3).End(xlUp).Row
VA = Range("A2:C" & DL).Value
For i = 1 To UBound(VA)
If VA(i, 1) > "" Then
L = i
Else
VA(L, 3) = VA(L, 3) & " - " & VA(i, 3)
VA(i, 3) = ""
End If
Next
Cells(2, 1).Resize(UBound(VA), 3).Value = VA
End Sub
Sub TestD()
' Ramener contenu de D
Dim VA, i&, L&
DL = Cells(Rows.Count, 4).End(xlUp).Row
VA = Range("A2:D" & DL).Value
For i = 1 To UBound(VA)
If VA(i, 1) > "" Then
L = i
Else
VA(L, 4) = VA(L, 3) & " - " & VA(i, 4)
VA(i, 4) = ""
End If
Next
Cells(2, 1).Resize(UBound(VA), 4).Value = VA
End Sub
Sub TestE()
' Ramener contenu de E
Dim VA, i&, L&
DL = Cells(Rows.Count, 5).End(xlUp).Row
VA = Range("A2:E" & DL).Value
For i = 1 To UBound(VA)
If VA(i, 1) > "" Then
L = i
Else
VA(L, 5) = VA(L, 5) & " - " & VA(i, 5)
VA(i, 5) = ""
End If
Next
Cells(2, 1).Resize(UBound(VA), 5).Value = VA
End Sub
Sub Lignesvides()
' Supprimer les lignes vides
Columns("A:A").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.ClearContents
Selection.ClearContents
Selection.EntireRow.Delete
End Sub |
Partager