Hello
If you’re not too attached to using Excel’s subtotal feature, you can retrieve data in a DataTable and calculate it internally within UiPath…
If you want to ensure the controls within the subtotal dialog mentioned above, you can set a filter like "<ctrl role='check box' />" with the FindChildren (find child elements) activity, which will give you a list of checkbox elements. Then, you can iterate through them with a ForEach, get the values using Get Text’s FullText for the respective elements, and based on the content of the retrieved values, you can branch conditions to check/uncheck them.
In summary, it would look something like this.
