Hi again Stef,
the table the data is being pulled from is dynamic via power query. So as the report changes this needs to recalculate because table rows are deleted or added
ok, thanks for that - it definitely explains what I was missing!

Well, it took a LOT of head-scratching, but I think I finally figured out the cause of the problem - the power query has not finished updating when you start inserting formulas, AND, it's not enough to just put a delay into the routine, the routine which triggers the refresh must be allowed to finish completely BEFORE any attempt is made to update formulas.
What this means is that the "Worksheet_Activate" routine must trigger the refresh, and then "set up" (via the OnTime method) the routine which updates the formulas.
I've also taken the liberty of playing around with the way that the formulas are inserted and updated. The various formulas are stored AS TEXT VALUES in Row 1 of the worksheet - this row can be hidden and/or moved to a different location if required. The fact that the formulas are stored as text values means that they will be unaffected by any rearrangement of the power query results table. The routine for inserting formulas retrieves the formula values from Row 1 and inserts them as formulas in the rows which correspond to the various rooms.
The code used in the worksheet module is as follows:
Anyway, hope this helps - take a look at the attached version of your workbook and see what you think.
Regards,
Greg M
Bookmarks