I have written the following code.

ActiveCell.FormulaR1C1 = _
"=CONCATENATE(RC[5],""-"",RC[6],""-"",RC[7],""-"",RC[ILastThread])"


Here iLastThread is the name of a variable where i stored the column number of a particular column. But this code is not working. But instead when i hard code the value in the variable there, then it will work. But i need to use the variable itself. as i dont know the column number or name in advance.

Please help me in regard of this.