samedi 30 janvier 2021

IFERROR with Index/Match excel formula not working in VBA

I am having an issue for excel formula index/match with IFERROR and it is working fine in excel when I am running it manually however after writing into Macro it is not working. this formula is created for doing matching and look-ups at multiple conditions and give the output result.

I am getting following error while running macro Run-time error'1004': Unable to set the FormulaArray property of the Range class

Can someone please help to suggest

Sub Indexmatch()
'
' Macro15 Macro
'

  '
  Selection.FormulaArray = _
    "=IFERROR(INDEX('[NAL for Macro.xlsb]Sheet1'!C13,MATCH(1,('[NAL for Macro.xlsb]Sheet1'!C8=RC[-8])*(LEFT('[NAL for Macro.xlsb]Sheet1'!C3,15)=LEFT(RC[-13],15)),0)),IFERROR(VLOOKUP(RC[-8],'[NAL for Macro.xlsb]Sheet1'!C8:C15,6,0),IFERROR(VLOOKUP(RC[-8],'[NAL for Macro.xlsb]Sheet1'!C9:C15,5,0),(VLOOKUP(LEFT(RC[-13],15)&""*"",'[NAL for Macro.xlsb]Sheet1'!C3:C15,11,0)))))"
 End Sub

Aucun commentaire:

Enregistrer un commentaire