I did following in purely VBA:

Sheets("temp3").Range(Cells(1, 1), Cells(no, 1)).Names.Add Name:="rngPop", RefersToR1C1:="=OFFSET($A$1,,,COUNTA($A:$A),1)"

But unfortunately, it is not working. I am fetting type mismatch error.

Any solution?

Regards,