-
Add formula to cell
Hello
I wrote a long formula in excel and i want to save time by insert it with code.
The formula is :
"=IF(ISERROR(VLOOKUP($A73,Sheet1!$A$1:$M$173,10,0))=TRUE,0,VLOOKUP($A73,She et1!$A$1:$M$173,10,0))"
What should i write in order to insrt it by code ?
Help is needed
Thanks
-
You can insert a formula as a range name and call it as in =Test
or
[VBA]
ActiveCell.Formula = "=IF(ISERROR(VLOOKUP($A73,Sheet1!$A$1:$M$173,10,0))=TRUE,0,VLOOKUP($A73,She et1!$A$1:$M$173,10,0))"
[/VBA]
-
Unnecessary test for TRUE
[vba]
ActiveCell.Formula = "=IF(ISERROR(VLOOKUP($A73,Sheet1!$A$1:$M$173,10,0)),0,VLOOKUP($A73,Sheet1!$ A$1:$M$173,10,0))"
[/vba]