Manjeet Singh
New Member
I have a excel formula which is working fine in excel manually however when I have tried to convert in to macro, it is not working. Can anyone please help me in converting the same. I am bit new to coding world and learning now.
Excel formula :
{=IFERROR(INDEX('[NAL for Macro.xlsb]Sheet1'!$M:$M,MATCH(1,('[NAL for Macro.xlsb]Sheet1'!$H:$H=G2)*(LEFT('[NAL for Macro.xlsb]Sheet1'!$C:$C,15)=LEFT(B2,15)),0)),IFERROR(VLOOKUP(G2,'[NAL for Macro.xlsb]Sheet1'!$H:$O,6,0),IFERROR(VLOOKUP(G2,'[NAL for Macro.xlsb]Sheet1'!$I:$O,5,0),(VLOOKUP(LEFT(B2,15)&"*",'[NAL for Macro.xlsb]Sheet1'!$C:$O,11,0)))))}
below is 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
Excel formula :
{=IFERROR(INDEX('[NAL for Macro.xlsb]Sheet1'!$M:$M,MATCH(1,('[NAL for Macro.xlsb]Sheet1'!$H:$H=G2)*(LEFT('[NAL for Macro.xlsb]Sheet1'!$C:$C,15)=LEFT(B2,15)),0)),IFERROR(VLOOKUP(G2,'[NAL for Macro.xlsb]Sheet1'!$H:$O,6,0),IFERROR(VLOOKUP(G2,'[NAL for Macro.xlsb]Sheet1'!$I:$O,5,0),(VLOOKUP(LEFT(B2,15)&"*",'[NAL for Macro.xlsb]Sheet1'!$C:$O,11,0)))))}
below is 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