I have this formula:
=IF(L61>0,IF(LEFT(P61,1)="*",TEXT(L61*VLOOKUP(MID(P61,2,3),DATA!M$110:W$163,MATCH(B$4,DATA!M$110:W$110,0),FALSE)/1000,"0.0")&"kg
"&TEXT(L61*VLOOKUP(RIGHT(P61,3),DATA!M$110:W$163,MATCH(B$4,DATA!M$110:W$110,0),FALSE)/1000,"0.0")&"kg",L61*VLOOKUP(P61,DATA!M$110:W$163,MATCH(B$4,DATA!M$110:W$110,0),FALSE)/1000),"")
I want to be able to put it in any cell in column "R" with macro, but when I record myself applying the formula I dont get the whole thing eg:
ActiveCell.FormulaR1C1 = _
"=RC[-6]>0 LEFT(RC[-2],1)=""*"" TEXT(RC[-6]*VLOOKUP(MID(RC[-2],2,3),DATA!R110C[-5]:R163C[5],MATCH(R4C[-16],DATA!R110C[-5]:R110C[5],0),FALSE)/1000,""0.0"")&""kg" & Chr(10) & """ RC[-6] RIGHT(RC[-2],3)"
I can copy and paste it from 1 cell to another with VBA but cant work out how to apply it just from code????
=IF(L61>0,IF(LEFT(P61,1)="*",TEXT(L61*VLOOKUP(MID(P61,2,3),DATA!M$110:W$163,MATCH(B$4,DATA!M$110:W$110,0),FALSE)/1000,"0.0")&"kg
"&TEXT(L61*VLOOKUP(RIGHT(P61,3),DATA!M$110:W$163,MATCH(B$4,DATA!M$110:W$110,0),FALSE)/1000,"0.0")&"kg",L61*VLOOKUP(P61,DATA!M$110:W$163,MATCH(B$4,DATA!M$110:W$110,0),FALSE)/1000),"")
I want to be able to put it in any cell in column "R" with macro, but when I record myself applying the formula I dont get the whole thing eg:
ActiveCell.FormulaR1C1 = _
"=RC[-6]>0 LEFT(RC[-2],1)=""*"" TEXT(RC[-6]*VLOOKUP(MID(RC[-2],2,3),DATA!R110C[-5]:R163C[5],MATCH(R4C[-16],DATA!R110C[-5]:R110C[5],0),FALSE)/1000,""0.0"")&""kg" & Chr(10) & """ RC[-6] RIGHT(RC[-2],3)"
I can copy and paste it from 1 cell to another with VBA but cant work out how to apply it just from code????