1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Option Base 1
Sub essai()
Dim Tbl, x As Long, tbl2(), y As Long, derlg As Long
derlg = Range("A" & Rows.Count).End(xlUp).Row
Tbl = Range("A3:B" & derlg)
y = 0
For x = 1 To UBound(Tbl)
If Tbl(x, 2) <> "" Then
y = y + 1
End If
Next x
ReDim tbl2(1 To y, 1 To 2)
y = 0
For x = 1 To UBound(Tbl)
If Tbl(x, 2) <> "" Then
y = y + 1
tbl2(y, 1) = Tbl(x, 1)
tbl2(y, 2) = Tbl(x, 2)
End If
Next x
Range("A3:B" & derlg).ClearContents
Range("A3:B" & UBound(tbl2, 1)) = tbl2
End Sub |
Partager