1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Private Sub CommandButton1_Click()
Dim C As Range, Ligne As Long
Dim Celselect As Range
Set Celselect = Application.InputBox("Sélectionnez les cellules", Type:=8)
With Sheets("Le matériel séléctionné")
For Each C In Celselect
If .[F9] = "" Then
C.Resize(, 2).Copy .Cells(9, 6)
Else
Ligne = Application.Match("Réseau", .[D:D], 0)
.Rows(Ligne).Insert
C.Resize(, 2).Copy .Cells(Ligne, 6)
.Cells(Ligne, 4).Resize(, 4).Borders(xlEdgeTop).LineStyle = xlLineStyleNone
End If
Next C
End With
End Sub |