• Go to Tools->References->

    Check the latest version of Microsoft ActiveX Data Objects and say OK.

    Now Hit Debug->Compile VBA Project. It shouldn't give you any error.

    Now upon running the function it will populate the Cells from A2 onwards

    Cheers,

    Nitya