In this post:

Get rid of any worry with merged cells in VBA Projects.

Not using the great design feature ‘merged cells’ is the credo of numerous developers throughout forums. And they are right - as long as they have not found a way to properly manage this kind of ‘obstruction’. I was not prepared to stay away from merged cells and implemented a way to manage them.

A service called MergedAreas temporarily eliminates (un-merges) merged cells and finally restores (re-merges) them in the meantime even allowing to delete concerned rows or insert new rows straight in the middle of a merged area.

The MergedAreas service (among others) is available in the mObstructions.bas which may be downloaded and imported into any Excel VBA Project. See the README in the public Github repository for details.

This is one of the obstruction services successfully used in a Common Rows Component. The component provides row services like move up/move down, insert new, or delete rows in protected Worksheets specifically focusing on the preservation of total formulas. However, that’s another story still pending to go public.