maabadi
Well-known Member
- Joined
- Oct 22, 2012
- Messages
- 2,681
- Office Version
- 2019
- 2016
- Platform
- Windows
Hi
I have this deactive macro for Sheet1 (data sheet)(create by right-click on sheet name and insert module):
and this is Pivotmacro :
when I run pivotmacro is working and see result changed, but when I change or add data on sheet1 (data sheet) and go to other sheets, I see the results don't change and macro didn't work. And also don't show errors and if run pivotmacro, it is work perfectly?! why?
Please Help
I have this deactive macro for Sheet1 (data sheet)(create by right-click on sheet name and insert module):
Code:
Private Sub Worksheet_Deactivate()
Run "PivotMacro"
End Sub
and this is Pivotmacro :
Code:
Sub PivotMacro()
Dim pt As PivotTable
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ActiveSheet.PivotTables
pt.RefreshTable
Next pt
Next ws
End Sub
when I run pivotmacro is working and see result changed, but when I change or add data on sheet1 (data sheet) and go to other sheets, I see the results don't change and macro didn't work. And also don't show errors and if run pivotmacro, it is work perfectly?! why?
Please Help