I suggest creating the
Formatted sheet by only copying the raw data sheet and then adding/deleting/highlighting stuff.
Reasons:
It's more straightforward and also more robust and faster; I'd worry, since your stage numbers don't always ascend, that when you filter for groups of stage numbers and copy blocks to another sheet, that that sheet might not have the stages in the correct time order.
Q1 The "Holds" stage 19, 27, 22 & 24 are all a specific time.
I always grab a few extra rows after a hold just in case the start and stop lands between 30 second data logs to show we met the customers time requirement.
I propose you don't do this, but if you must, do it by only 1 row. If it happens that the target temperatures and pressures are not met in time, then maybe overlap some more - the code can do this, as well as highlighting this failure to meet targets.
Our control software was written to add the notation "Delta Pause" if both Temperature and Pressure are not in spec, unfortunately only on the low side. This is why I change stage 19 Delta Pause to stage 18 and the same for stage 27. This gives me the exact row that these two holds start.
The final
Formatted sheet shows the un-adjusted stage numbers, so it seems you only changed the numbers for filtering/copying. Code can determine where to put the likes of
Intermediate Hold Start and
Hold Start and the bolding.
I don't get that when its cooling down to a set of parameters
For this cycle we go in after running this macro and highlight the first row of stage 22 and 24 that are all green.
Again, this is easy for the code to do without moving anything around. A variant of the
blah macro in msg#4 will do it.
Q2 So after its all done the Graph and Run Data pages are printed, signed and sent to the customer.
The formatted tab is copied to another workbook, columns G:J are removed and this is emailed to the customer.
We save the file after the macro is run.
This data has to be available for a customer, NADCAP or AS auditor if the want to see how we verified the cycle parameters.
It's all quite do-able. I imagine that you need to do this for a wide range of runs with different protocols/recipes and different thresholds; currently you use hard-coded values, but these values must come from somewhere - you don't do all runs with the same thresholds do you? Where can that data be found and made available to the code?
One question I do have is about the
Run Data sheet which seems to only deal with stage 27. Your current data doesn't need any adjustment of stage 27 numbering so in other cases, does that
Run Data sheet summarise original stage 27 or adjusted stage 27?
Finally, to whet your appetite, the attached contains just your original raw data sheet and 30 lines of code, run by clicking the button on the sheet.
It creates a new sheet which will become the
Run Data sheet after a few more additions and formatting.