RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 789
- Office Version
- 2010
- Platform
- Windows
VBA Code:
Cells(ActiveCell.Row, "I").FormulaArray = "=INDEX('[Advert Creation Master 2020.xlsm]Advert Rows'!C43,MATCH(1,(" & papnam & "='[Advert Creation Master 2020.xlsm]Advert Rows'!C1)*(" & tpl & "='[Advert Creation Master 2020.xlsm]Advert Rows'!C3),0))"
Have a gander at that. Multi Criteria Index Match follows this structure:
{=Index([Results],match(1,([Criteria1]=[Criteria1Range])*([Criteria2]=[Criteria2Range]),0))}
So the Criteria 1 and Criteria 2 I need to change. I have them loaded as "papnam" and "tpl" - these variables are loaded in as "Wolverhampton Chronicle" and "WOL_18x8_3UK"
This gives me this:
VBA Code:
=INDEX('[Advert Creation Master 2020.xlsm]Advert Rows'!C43,MATCH(1,(Wolverhampton Chronicle='[Advert Creation Master 2020.xlsm]Advert Rows'!C1)*(WOL_18x8_3UK='[Advert Creation Master 2020.xlsm]Advert Rows'!C3),0))
So nearly there, but I do need to get a "" surrounding the criteria. So I do this:
VBA Code:
Cells(ActiveCell.Row, "I").FormulaArray = "=INDEX('[Advert Creation Master 2020.xlsm]Advert Rows'!C43,MATCH(1,(" & " & papnam & " & "='[Advert Creation Master 2020.xlsm]Advert Rows'!C1)*(" & "& tpl & " & "='[Advert Creation Master 2020.xlsm]Advert Rows'!C3),0))"
And I get "unable to set the FormulaArray property of the range class"
Any ideas? Thanks.