Re : fusion de plage horaire
Re:
Voila, j'ai essayé d'adapter cette macro, mais ca me met une erreur 400, quelqu'un peut-il m'aider?
Sub FusionLignes()
Dim i As Integer, j As Integer, Lig As Integer, Tablo
With Sheets("Feuil2")
Lig = .Range("A65536").End(xlUp).Row
Tablo = .Range("A2
" & Lig)
For i = 1 To Lig - 2
'If Tablo(i, 1) <> """" And Tablo(i, 4) <> """" Then
For j = i + 1 To Lig - 1
If Tablo(j, 1) <> "" Then
If Tablo(i, 4) = Tablo(j, 4) And _
Tablo(i, 1) >= Tablo(j, 1) And Tablo(i, 1) <= Tablo(j, 2) Then
Tablo(i, 2) = Tablo(j, 2) And Tablo(i, 3) = Tablo(i, 2) - Tablo(i, 1)
Tablo(i, 3) = Tablo(i, 2) - Tablo(i, 1)
Tablo(j, 1) = "": Tablo(j, 2) = "": Tablo(j, 3) = "": Tablo(j, 4) = ""
End If
End If
Next j
Next i
.Range("A2
" & Lig) = Tablo
.Range("A2
" & Lig).Sort Key1:=Range("A2"), Order1:=xlAscending
End With
End Sub
a+