Still not understand what you want,give sample workbook or picture
Maybe from this coding can you modifay
sub test()
Dim lrow as long,x,s$,arr
Dim k(1 to 4),c2,d2,e2,g2
With sheets("database")
x = .range("C2",.[N10000].end(3)).value
End with
With sheets("Result")
c2= .[c2].value : d2=.[d2].value :e2= .[e2].value :g2 =.[g2].value
For i = 3 To ubound(x)
k(1) = x(i,10) >= c2
k(2) = x(i,11) <= d2
k(3) = x(i,12) <= e2
k(4) = x(i,14) = g2
If k(1) * k(2) * k(3) * k(4) then
s = iif(s="",i,s & "," & i)
End if
Next i
arr = split(s,",")
.Range("I12").Offset(1, -8).resize(ubound(arr),ubound(x,2)) = application.index(x,application.transpose(arr),0)
End with
End sub
Bookmarks