Merged cells cause no end of problems with copying, pasting, sorting,
filtering, row fitting(as you have discovered) and many other functions.
Center across selection is one alternative.
Merged cells have their place for presentation only but if you have to be
able to manipulate data they will cause you grief.
Where did you insert the code? It must be pasted into the sheet module as
described.
Your cells must be set to wrap text and rows set to autofit prior to adding
the code and entering data in merged cells.
Gord