Hello,
Formula :
Dim machines As String
Dim wk As Integer
Dim var As Integer
machines = "LB300"
wk = 1027
var = Application.WorksheetFunction.CountIfs(Sheets("Hoofd-Overzicht").Range("A:A"), "&wk&", Range("D:D"), "&machine&")
For x = 1 To ((Range("$F$3") - 1) /...