Hi,

Im trying to concatenate the cells dynamically using the active cell.formula option in excel Vba. iI'm using the below code but im getting an error when i run it. I tried a couple of ways but not able to do it. Can someone help me out and let me know where i'm missing.

Below are the codes I tried. (A and B are column numbers which are obtained dynamically using Match function)

ActiveCell.Formula = "=Cells(2, a) & Cells(2, b)"
ActiveCell.formula = "=Concatenate (Cells(2, a),Cells(2, b))
Thanks for the help

Regards