Maybe with this
Sub test()
Sheets.Add after:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = "result"
Range("D1") = "Week Nr"
With Sheets("Raw")
.Range("A1", "C1").Copy Sheets("result").Range("A1")
lr = .Range("A" & Rows.Count).End(xlUp).Row
lc = .Cells(1, Columns.Count).End(xlToLeft).Column
For x = 2 To lc Step 2
j = 0
qt = Application.CountIf(.Range(.Cells(2, x), .Cells(lr, x)), ">0")
If qt > 0 Then
ReDim arr(1 To qt, 1 To 4)
j = j + 1
For i = 2 To lr
If .Cells(i, x).Value > 0 And .Cells(i, x + 1).Value > 0 Then
arr(j, 1) = .Range("A" & i)
arr(j, 2) = .Cells(i, x).Value
arr(j, 3) = .Cells(i, x + 1).Value
arr(j, 4) = Application.IsoWeekNum(.Cells(i, x + 1))
j = j + 1
End If
Next
Sheets("result").Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(UBound(arr), 4) = arr
End If
Next
End With
With Sheets("Result")
.Columns.AutoFit
.Range("C1").Copy
With .Range("D1")
.PasteSpecial Paste:=xlPasteFormats
End With
End With
Application.CutCopyMode = False
End Sub
Kind regards
Bookmarks