countryfan_nt
Well-known Member
- Joined
- May 19, 2004
- Messages
- 765
Hello friends, hope all is well!
Please help with code; I am getting: VBA Runtime Error 1004 “Application-defined or Object-defined error”.
I am trying to choose / filter the row field, from the range A1:A100 of sheet2.
so whatever is in range A1:A100 will impact and chosen to filter the powerpivot.
Please help correct the below VB code.
Thank you very much in advance!
Please help with code; I am getting: VBA Runtime Error 1004 “Application-defined or Object-defined error”.
I am trying to choose / filter the row field, from the range A1:A100 of sheet2.
so whatever is in range A1:A100 will impact and chosen to filter the powerpivot.
Please help correct the below VB code.
Thank you very much in advance!
Code:
Sub Macro1()
Dim c As Range
For Each c In Sheets("Sheet2").Range("A1:A100") '<<< ADAPT AS REQUIRED
ActiveSheet.PivotTables("PivotTable1").PivotFields("[db].[ID].[ID]"). _
VisibleItemsList = Array("[db].[ID].&[c.value]")
Next c
End Sub