Hi ALl
Can someone please help me, i am trying to use a formula in a VBA script but it seems the formula is too long
The formula works perfectly in the cell, but when i try to insert it on the VBA script, i get a Runtime 1004 error.
This is my insanely cumbersome formula
=IFERROR(VLOOKUP((LEFT(A2,12))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,11))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,10))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,9))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,8))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,7))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,6))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,5))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,4))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,3))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,2))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,1))+0,PIP!$A:$D,4,FALSE),""))))))))))))
Can anyone please help me so simplify it without losing the functionality
Can someone please help me, i am trying to use a formula in a VBA script but it seems the formula is too long
The formula works perfectly in the cell, but when i try to insert it on the VBA script, i get a Runtime 1004 error.
This is my insanely cumbersome formula
=IFERROR(VLOOKUP((LEFT(A2,12))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,11))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,10))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,9))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,8))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,7))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,6))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,5))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,4))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,3))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,2))+0,PIP!$A:$D,4,FALSE),IFERROR(VLOOKUP((LEFT(A2,1))+0,PIP!$A:$D,4,FALSE),""))))))))))))
Can anyone please help me so simplify it without losing the functionality