No in a VBA module.
Best to add to your Personal Macro Workbook if you are going to use it.
This explain how to create the Personal Macro workbook
https://www.myonlinetraininghub.com/...-personal-xlsb
Once done, copy that code into a module and create a shortcut button on your quick access toolbar.
Then when yoiu want to merge 2 cells select the top one, click the button and it will be meged (only works on 2 cells vertically - but possible to improve)
Purfleet