Hi All
Can't seem to figure out why I get the "Expected Array" error in below code. So I'm hoping you can help me?
The error occurs in the last line
[VBA]
Sub test()
Dim x As Integer
If Application.CountIf(Sheets("Sheet2").Columns(1), "2") = 0 Then Exit Sub
With Sheets("Sheet2")
With .Range("a1", .Cells.SpecialCells(11)).Resize(, 16)
x = Filter(.Parent.Evaluate("transpose(if(" & .Columns(1).Address & _
"=""2"",row(1:" & .Rows.Count & "),char(2)))"), Chr(2), 0)
x = Application.Index(.Value, Application.Transpose(x) _
, [{1,2}])
End With
End With
Sheets("Sheet2").Range("d2:e30").ClearContents
Sheets("Sheet2").Range("d30").End(xlUp)(2) _
.Resize(UBound(x, 1), 2).Value = x
End Sub
[/VBA]
[ATTACH=JSON]{"alt":"Click image for larger version Name:\tCapture.PNG Views:\t1 Size:\t58.7 KB ID:\t1211400","data-align":"none","data-attachmentid":"1211400","data-size":"full","title":"Capture.PNG"}[/ATTACH]
Regards
Stefan