Spikenaylor
Board Regular
- Joined
- Apr 14, 2013
- Messages
- 115
- Office Version
- 365
- Platform
- Windows
Hi
My code on worksheet activate is
The defined name range "Batch_ChartNumbers" is populated by the end user and a report is generated, once the report is generated, the spreadsheet closes deleting the end users inputs, next time the spreadsheet is open the end users enters new data.
Works great until the defined name range doesn't contain anything and the report button is pressed or the end user clicks on the pivottable worksheet.
tried a few methods to fix, but can't get it to filter to blanks or nothing until the next time the defined name range is poulated, it keeps the previous user entered data in the pivot table "Batch Report" field.
Could anyone help please
Thanks very much
My code on worksheet activate is
Code:
Private Sub Worksheet_activate() Dim pt As PivotTable
Dim RolePick As Range
Set RolePick = [Batch_ChartNumbers]
For Each pt In Sheets("Debox Flock report").PivotTables
Filter_PivotField pvtField:=pt.PivotFields("Batch Report"), varItemList:=Application.Transpose(RolePick)
Next pt
End Sub
The defined name range "Batch_ChartNumbers" is populated by the end user and a report is generated, once the report is generated, the spreadsheet closes deleting the end users inputs, next time the spreadsheet is open the end users enters new data.
Works great until the defined name range doesn't contain anything and the report button is pressed or the end user clicks on the pivottable worksheet.
tried a few methods to fix, but can't get it to filter to blanks or nothing until the next time the defined name range is poulated, it keeps the previous user entered data in the pivot table "Batch Report" field.
Could anyone help please
Thanks very much