Hello! I am missing something in my code and need a little assistance 
I have a sheet (Item Lookup) that contains a pivot table with page fields and 6000 part numbers. I can manually select a part number, the pivot table will update the usage for that part, and do some other calculations on another sheet (LDY Test). I then want to copy those calculated values and paste on a "Results" sheet. I can get the loop to work up to the point where it copies the values on the LDY Test sheet, then it errors out. Not sure what I am doing wrong here.
Sub Loop_PivotItems()
Sheets("Item Lookup").Select
For Each PivotItem In ActiveSheet.PivotTables(1).PageFields(1).PivotItems
ActiveSheet.PivotTables(1).PageFields(1).CurrentPage = PivotItem.Value
Sheets("LDY Test").Range("B1:B6").Copy
Sheets("Results").Select
Range("A1").Select
For Z = 1 To 6500
ActiveCell.Offset(1, 0).Range("A1").Select
If ActiveCell.Value = "" Then
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=Flase, Transpose:=True
End If
Next Z
Next
End Sub
I have a sheet (Item Lookup) that contains a pivot table with page fields and 6000 part numbers. I can manually select a part number, the pivot table will update the usage for that part, and do some other calculations on another sheet (LDY Test). I then want to copy those calculated values and paste on a "Results" sheet. I can get the loop to work up to the point where it copies the values on the LDY Test sheet, then it errors out. Not sure what I am doing wrong here.
Sub Loop_PivotItems()
Sheets("Item Lookup").Select
For Each PivotItem In ActiveSheet.PivotTables(1).PageFields(1).PivotItems
ActiveSheet.PivotTables(1).PageFields(1).CurrentPage = PivotItem.Value
Sheets("LDY Test").Range("B1:B6").Copy
Sheets("Results").Select
Range("A1").Select
For Z = 1 To 6500
ActiveCell.Offset(1, 0).Range("A1").Select
If ActiveCell.Value = "" Then
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=Flase, Transpose:=True
End If
Next Z
Next
End Sub