Private Sub CommandButton1_Click()
Dim temp As Range
With Blad1.Cells(1, 10).CurrentRegion
.ClearContents
.NumberFormat = "@"
Set temp = Blad1.Cells(1).CurrentRegion
sn = Blad1.Cells(1).CurrentRegion.Resize(Blad1.Cells(1).CurrentRegion.Rows.Count + 1)
For j = 1 To UBound(sn) - 1
t0 = WorksheetFunction.Text(CDate(Left(sn(j, 1), 5)) + 1 / 24, "[hh]mm")
t1 = WorksheetFunction.Text(CDate(Left(sn(j + 1, 1) & "00000", 5)) + 1 / 24, "[hh]mm")
If sn(j, 3) = sn(j + 1, 3) Then
Blad1.Range(Cells(j, 10), Cells(j, 18)) = Array(t0, t1, sn(j, 2), sn(j + 1, 2), sn(j, 3), sn(j, 4), sn(j, 5), sn(j + 1, 5), sn(j, 6))
j = j + 1
ElseIf sn(j, 4) = "EBBR" Then
Blad1.Range(Cells(j, 10), Cells(j, 18)) = Array(t0, t0, "-", sn(j, 2), sn(j, 3), "-", sn(j, 4), sn(j, 5), sn(j, 6))
Else
Blad1.Range(Cells(j, 10), Cells(j, 18)) = Array(t0, "-", sn(j, 2), "-", sn(j, 3), sn(j, 4), sn(j, 5), "-", sn(j, 6))
End If
Next
End With
Blad1.Range(Cells(1, 10), Cells(j, 18)).Sort Blad1.Cells(1, 10)
For Each temp In Blad1.Cells(1, 10).CurrentRegion.Columns(1).Cells
If temp = temp(1, 2) Then temp = "-"
Next
End Sub