hi Dedaluss, welcome to Excelforum,
option basing on the code provided (not tested due no sample file have been presented)
Option Explicit
Sub Analyse_data()
Dim i As Long, n As Long, j As Long, lrow As Long
Dim sh As Worksheet, targetsh As Worksheet
Dim data, result
Set sh = Sheets("PakkeIndtag")
Set targetsh = Sheets("Data")
lrow = sh.Cells(Rows.Count, 1).End(xlUp).Row
data = sh.Range("a1:e" & lrow + 5)
ReDim result(1 To lrow, 1 To 7)
For i = 5 To lrow Step 6
For n = i To i + 4
If data(n, 1) <> "" Then
j = j + 1
result(j, 1) = data(1, 1) 'Station
result(j, 2) = data(n, 1) 'MaskinTid
result(j, 3) = data(n, 3) 'StopType
result(j, 4) = data(n, 4) 'MaskinTid
result(j, 5) = data(i, 1) 'Dag
result(j, 6) = data(i, 2) 'Uge
result(j, 7) = data(i, 6) 'Aar
Else
Exit For
End If
Next
Next
targetsh.Range(2, 1).Resize(j, 7) = result
End Sub
Bookmarks