I have written a long code, creating 5 different pivots, though If some data did not appear in specified period I would like to ommit this table.

Therefore I have created a code in type of



   On Error GoTo ErrHandler1
        
        
        ActiveSheet.PivotTables("Tabela KM").PivotFields("Skrot"). _
        CurrentPage = "KM"


'more pivot table things         
       
    Exit Sub


ErrHandler1:


On Error GoTo ErrHandler2
        
        
        ActiveSheet.PivotTables("Tabela LVM").PivotFields("Skrot"). _
        CurrentPage = "LVW"


'more pivot table things         
       
    Exit Sub


ErrHandler2:
(5 loops this way^^)

Though it does freeze after filtering with KM at first.

The purpose was to skip 1 pivot if unable to filter with criteria.

Could you help me out?