I'm using Office 365. I have a pivot table that I need to refresh using vba. I am doing that through ThisWorkbook.RefreshAll. I am running into issues because the refresh clears out any conditional formatting I have set up. I've tried to apply the conditional formatting through vba, but this is problematic also because the refresh takes a few seconds to complete and the vba code moves to the next line before it's complete. So, the conditional formatting gets applied and then it gets cleared when the pivot table refresh completes. Can anyone help? I'm hoping there's a way to apply the formatting directly to the pivot table without the need for vba and in such a way that it doesn't clear upon refresh.

I've cross-posted this here: https://www.reddit.com/r/excel/comme...ng_to_a_pivot/
But, unfortunately, none of the answers on that post were able to solve my problem.