I have a macro that pulls data from one worksheet, creates a new worksheet and adds a pivot table. I want to add an event handler to the pivot table of the new sheet.
How do I add the event handler code with VBA rather than copying a text file and pasting it to the Pivot Sheet?
How do I add the event handler code with VBA rather than copying a text file and pasting it to the Pivot Sheet?
Code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
' Header 1
Range("B2:C2").Select
With Selection.Interior
.Color = RGB(210, 230, 230)
End With
‘ Some more code…
End Sub
Last edited by a moderator: