How to figure out a pivot table needs to be refreshed in VBA?

Hi

I have a pivot table in a sheet. When the sheet is activated, I refresh it.
As refreshing takes time, I like to refresh it only when the source data has been changed. How can I figure out it in VBA?

Thanks,

Amin