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
| Sub Completude()
Dim NbLigne, i, j As Integer
''Evaluation du nombre de lignes du fichier
NbLigne = Cells.SpecialCells(xlCellTypeLastCell).Row
For i = 2 To NbLigne Step 1
If Cells(i, 6) > 1 Then
j = i + 1
While Cells(j, 2).Value = ""
''Mise à jour de la date
Cells(j, 2).Value = Cells(i, 2).Value
''Mise à jour de l'heure avec conservation du format
Cells(i, 3).Select
Selection.Copy
Cells(j, 3).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
''Mise à jour du nombre de bateau
Cells(j, 6).Value = "1"
j = j + 1
Wend
End If
Next i
End Sub |
Partager