I have a macro from a large complex workbook, that allows a user to set a list of cell references, and have that data be exported to another workbook.
I recently transitioned to starting to using Structured Table references, which saves a lot of time when the layout of the sheets changes, as the code in VBA doesn't have to change to match.
The issue is that on the first time the macro runs after the workbook is opened, the line setting the Range variable fails if it is a structured reference.
Where expRng.Cells(i, "D").Value is the cell containing the range reference as a string, ie "CalcsTbl[[#Totals],[$ TOTsav/yr]]"
If I kill the macro and start again, it works perfectly.
Note that in the above code, intellisense sets range() to a lowercase word. If I copy the code to any other workbook, intellisense capitalises Range(), and I cannot recreate the bug.
Here is all the relevant subs, and a small example anonyminised workbook.
If anyone can suggest things that would cause this, or see any mistakes I'm making, it would be greatly appreciated
Bookmarks