Need to know the excel macro


I have a data like this which I would like to know the macro function.

Row column A
1 123
2 456
3 789

Am currently using formula for my expected result as =selecting cell A1&","&A2&","&A3 which will be coming in my excel cell as 123,345,456

Please provide a macro function to automate this. Also provide a macro function to use this as default macro for X numbers (Above is limited)