Hi I was hoping that someone can point me in the right direction in showing me how to refer to a cell value inside VBA code.
I am working with pivot tables where i select from a list to give me the values i require. So far i have managed to create and run a macro that selects the values for me. My problem is that I want to make the code generic and use a cell value as part of the code.
At the moment i have:
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[PRACTICE].[PRACTICE].[Practice]").VisibleItemsList = Array( _
"[PRACTICE].[PRACTICE].[Practice].&[TRENTSIDE]")
What I would like is to remove 'TRENTSIDE' and instead refer to a cell value i.e. WorkSheet("PackCreator") Sheets("Pack") Range("I8")
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[PRACTICE].[PRACTICE].[Practice]").VisibleItemsList = Array( _
"[PRACTICE].[PRACTICE].[Practice].&[CELL VALUE!!!!!!!]")
I hope I have explained this well enough! I am sure there is a simple way but I am struggling....thanks for any help
I am working with pivot tables where i select from a list to give me the values i require. So far i have managed to create and run a macro that selects the values for me. My problem is that I want to make the code generic and use a cell value as part of the code.
At the moment i have:
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[PRACTICE].[PRACTICE].[Practice]").VisibleItemsList = Array( _
"[PRACTICE].[PRACTICE].[Practice].&[TRENTSIDE]")
What I would like is to remove 'TRENTSIDE' and instead refer to a cell value i.e. WorkSheet("PackCreator") Sheets("Pack") Range("I8")
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[PRACTICE].[PRACTICE].[Practice]").VisibleItemsList = Array( _
"[PRACTICE].[PRACTICE].[Practice].&[CELL VALUE!!!!!!!]")
I hope I have explained this well enough! I am sure there is a simple way but I am struggling....thanks for any help