Ugh, Merged Cells...the bane of a excel programmer.
Thankfully, it is possible to work around in this case. Quick explanation:
When you merge cells, say A2:C2, and then click on the cell and type something, XL is actually storing the value in cell A2, and sort of "hiding" the other 2 cells. SImilarly, when you select the merged cell and give it a name, it only applies the name to A2.
Now, all of this would be great, except when you get to VB. When VB tries to use the name, and goes to edit
only A2, it freaks out because A2 is sorta wishy-washy tied into B2:C2, and it's won't modify part of a merged cell. Makes no sense at all, I know, but there it is.
So, this leads us to the work-around. In the defintiion of your named range, need to modify the cell addresses to include all the cells in the merged cell. So, say MyDataCells is supposed to be cell A2, C5, and merged cells
E4:E10. If you go to the Name Manager, you'll see that it would just like:
=Sheet1!A2,Sheet1!C5,Sheet1!
E4
Need to change this to include all the cells, like so:
=Sheet1!A2,Sheet1!C5,Sheet1!
E4:E10
Then, the VB will have all the cells' addresses and it should work.