Hi Bob, many thanks for your kind interest in this problem.

Quote Originally Posted by xld
This doesn't change the r range so it shouldn't affect the union, but just uses row x in the activate rather that row 1 as you had it.
I initially meant that the range "r" actually changes throughout the code. But I believe you meant defining the ac right up the top of the cdoe, where "r" is first defined, not at the bottom. As such, your method indeed will work. Please correct me if I misunderstood you.


Quote Originally Posted by xld
I am not sure and I don't think I have the patience to read all 11 pages of that article, but MD's addin was already fully functional, just making that change should ensure that the toolbar is always setup. The other changes re for the function changes that you require.

I am also not sure that you mean error handling, or at least error catching. It seems to me that you want it to behave differently if there is no room to behave normally, which is a different thing. In that case, it needs to be coded accordingly.
Bob, md. I hope taht when I meant to use Johnske's Addin example that i did not come across that I had any issues with md's approach in anyway.

Bob, I wasn't sure what you had meant by:

Quote Originally Posted by xld
Try moving the toolbar build code to Workbook_Open.
As such I searched around anf found that johnske had done it in his generic Add-in creation template. However adding in this code required all the other modules in that article (from what I could understand), and as such, I thought to ask you both for the article, so that I could amend it appropriately. Though it seems that the solution may be a quick addition to md's existing add-in event code.

Could you please assist with this code Bob?

Also Bob, thank you for your elegant code in post #28. I was wondering when I was going to see your solution with Enums .

Based on some testing, I was wondering if it could be corrected for the following issues:
  1. single row selected - as per Malcolm's reference to post #27, which malcolms code addresses.
  2. checks it will fit on sheet
  3. check that only a range is selected
  4. multiple areas selected
  5. multi-row and multi-column block uses first column only
I always love reading your great code, I am keen to understand how it could be adapted for the above changes.