I have a drop down that should update the pivot tables and it does, but i have to click on the DivisionCode named cell, (I just want to be able to use the drop down to initiate the code)
Any other ideas on this?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'This line stops the worksheet updating on every change, it only updates when cell
'R6 is touched
If Intersect(Target, Range("DivisionCode")) Is Nothing Then Exit Sub
'Set the Variables to be used
Dim pt As PivotTable
Dim Field As PivotField
Dim NewCat As String
'Here you amend to suit your data
Set pt = Worksheets("HP Dash").PivotTables("PivotTable4")
Set Field = pt.PivotFields("Division")
NewCat = Worksheets("HP Dash").Range("DivisionCode").Value
'This updates and refreshes the PIVOT table
With pt
Field.ClearAllFilters
Field.CurrentPage = NewCat
pt.RefreshTable
End With
End Sub
Bookmarks