Helloooo everybody,
I've been trying to get this to work almost all day now and I think I'm going insane. Basically what I want to do is get the following matrix function to work in VBA: =INDEX(Inkoopfacturen!$K:$K, SMALL(IF(Bankmutaties!$B$4=Inkoopfacturen!$J:$J, ROW(Inkoopfacturen!$J:$J)-ROW(Inkoopfacturen!$B$2)+1), ROW(1:1)))
I've got this:
Dim SearchValue As Range
Dim SearchArea As Range
Dim StartingPoint As Range
Dim ResultArea As Range
SearchArea = Worksheets("Inkoopfacturen").Range("J:J")
SearchValue = Worksheets("Bankmutaties").Range("B2").End(xlDown).Offset(1, 4).Value
ResultArea = Worksheets("Inkoopfacturen").Range("K:K")
StartingPoint = Worksheets("Inkoopfacturen").Range("B2")
Me.cboInkoopfactuur.AddItem Application.WorksheetFunction.INDEX(ResultArea, SMALL(IF(SearchValue=SearchArea; ROW(SearchArea)-ROW(StartingPoint)+1), ROW(1:1)))
I get an error at the IF statement.
Any tips or solutions would be terribly appreciated!
Bookmarks