Hi friends, I have a question to ask you, I have created this code that allows me to update a pivot table to the various data of the column a. The problem is that I would like to make these changes in the backgroud. but unfortunately nothing seems to work.
https://youtu.be/3xiR3G_2tJU
code worksheet
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Skip
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Call Scopri_colonne
If Not Intersect(Target, [A:A]) Is Nothing Then
Call AGGIORNA_PIVOT
End If
Skip:
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
code module
Public Sub AGGIORNA_PIVOT()
ActiveSheet.PivotTables("Tabella_pivot1").PivotCache.Refresh
With ActiveSheet.PivotTables("Tabella_pivot1").PivotFields("GRUPPO MUSCOLARE")
.ClearAllFilters
.ShowAllItems = True
.PivotItems("GRUPPO MUSCOLARE").Visible = False
.PivotItems("(blank)").Visible = False
End With
Range("EE8:EF42").Select
With Selection.Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
Bookmarks