Do you want it directly to output?
Option Explicit
Global myArray
Sub test_Your_Formula()
Dim x As Long
With Sheets("sheet3")
myArray = .[FILTER($O$2:$W$47761,($U$2:$U$47761 > 0)*($U$2:$U$47761 < $A$6),"No Combo")]
With .Range("ac" & Rows.Count).End(xlUp)(2)
If IsArray(myArray) Then
On Error Resume Next
x = UBound(myArray, 2)
On Error GoTo 0
If x = 0 Then
.Resize(, UBound(myArray) - 1) = Application.Index(myArray, [{1,2,3,4,5,7,8,9}])
Else
.Resize(UBound(myArray), UBound(myArray, 2)) = Application.Index(myArray, _
Evaluate("row(1:" & UBound(myArray) & ")"), [{1,2,3,4,5,7,8,9}])
End If
Else
.Value = myArray
End If
End With
End With
End Sub
Sub testHow_I_Do()
Dim x
With Sheets("sheet3")
With .Range("o1").CurrentRegion
x = .Columns(7).Address
x = Filter(.Parent.Evaluate("transpose(if((" & x & ">0)*(" & x & "<a6),row(" & x & ")))"), False, 0)
If UBound(x) > -1 Then myArray = Application.Index(.Value, Application.Transpose(x), [{1,2,3,4,5,7,8,9}])
End With
With .Range("ac" & Rows.Count).End(xlUp)(2)
If UBound(x) > -1 Then
If UBound(x) > 0 Then
.Resize(UBound(myArray, 1), UBound(myArray, 2)) = myArray
Else
.Resize(, UBound(myArray)) = myArray
End If
Else
.Value = "No Combo"
End If
End With
End With
End Sub
Bookmarks