I've had a look at this more thoroughly now and the problem is actually quite an obvious one but one that I did not account for in testing...namely items which exist in one PT may not exist in another ... and this could be caused by a number of issues...
a) values are simply different
b) legacy items exist in the item listings
Now point b) is an interesting one and one that made me think a little more about this... in general given you want to give each PT the most opportunity of being identical you need to ensure that when you refresh one PT you refresh them all... however the act of Refresh is different to making selections etc (ie the former is based on a premise that underlying data has altered) yet refreshing via the Refresh button will
1) only refresh the relevant cache
2) invoke the update event
given the possibility of problem a) we then need to try and restrict the opportunity for error by not invoking the update event on a standard refresh...how to do this ?
Well I thought about it and came up with the idea of disabling/creating some custom controls on the right-click PT menu, ie into ThisWorkbook:
and then into a new module
The code for the refresh All should for sake of clarity reside in a new & separate module
What all of the above will do is ensure you can only refresh All PT's simultaneously via the right-click menu and "new" option added namely: Refresh All ... and
when this is done the BeforeUpdate event is NOT invoked (it will also remove "legacy" items from any/all lists)
Now the above still does not resolve the problem that given the data sources for each PT are different it's still quite possible that items will exist in one PT but not in another, for ex. you may run an Edit->Replace on all which columns but forget to update the last one meaning the same options do not exist in all PT's ... this may be highly unlikely however it is still a possibility.
On that basis you then need to think about adding handlers around the setting of item visibility so I would change the existing Select Case section to
And all of that together *should* I think resolve your issue(s) ?
Bookmarks