For example, I want to change the lookup value (rows) and the columns in which the formula is being applied. I tried to make it dynamic
1) what is the rule behind the "dynamic" way you want to achieve
2) do you already want to have the result or do you want to apply the formula into the cell
3) I assume you did not test the code because it is failing at "Workbooks("Input File").Close"
4) what kind of error do you expect inside the for-loop (you used "on error resume next")