I have one macro to call when any value changes in a range of cells then worksheet cvhange event fires and call this macro. This macro is used to copy pivot data from one sheet to the active sheet but this is not pasting the data. here is the code . please help to process this.
Worksheet code
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:J17")) Is Nothing Then
Call Record
End If
End Sub
Macro code
Sub Record()
'
' Record Macro
'
'
' ActiveSheet.PivotTables("PivotTable1").PivotSelect "STORE[All]", xlLabelOnly, _
True
If (Sheets("Exceptions").Range("C19") <> Empty) Then
With Sheets("Exceptions")
.Rows(19 & ":" & .Rows.count).Delete
End With
End If
With Sheets("Sheet1")
.PivotTables("Master").PivotSelect "", xlDataOnly, True
Selection.CurrentRegion.Copy
'Selection.Copy
End With
'With Sheets("Exceptions")
'.Select
Sheets("Exceptions").Range("C19").PasteSpecial
'End With
End Sub
Bookmarks