I want a simple macro to copy all data below column headers in a pivot table and paste to another sheet. I've tried multiple methods for selecting the data to copy and it always gives me the same error. "run-time error 438, Object doesn't support this property or method." Below is the code. Any ideas why I keep getting this error?
Sheets("TaskStatus").Pivotables("TaskStatus").DataBodyRange.Select
Selection.Copy
Sheets("Change_Data").Select
Range("A5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("TaskStatus").Pivotables("TaskStatus").DataBodyRange.Select
Selection.Copy
Sheets("Change_Data").Select
Range("A5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False