dversloot1
Board Regular
- Joined
- Apr 3, 2013
- Messages
- 113
Hello!
I'm normally pretty good a googling a solution for a VBA problem however this one has be stumped.
Recently, our IT department transitioned one data cube over to another. In this new Data Cube our SKUs are now assigned a value. This value though is not shown in any accessible field. I discovered the SKU to value relationship when I recorded a macro:
ActiveSheet.PivotTables("PivotTable1").PivotFields("[Item].[SKU].[SKU]").ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields("[Item].[SKU].[SKU]").CurrentPageName = "[Item].[SKU].&[2523]"
The code use to be:
ActiveSheet.PivotTables("PivotTable1").PivotFields("[Item].[SKU].[SKU]").ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields("[Item].[SKU].[SKU]").CurrentPageName = "[Item].[SKU].&[abcdefg]"
I'm wondering if anyone knows how to code a loop through each of the SKUs in the cube, then to copy the corresponding value to a reference table in a sheet.
Ideally like this:
[TABLE="width: 142"]
<tbody>[TR]
[TD]SKU[/TD]
[TD]VALUE[/TD]
[/TR]
[TR]
[TD]abc[/TD]
[TD="align: right"]123[/TD]
[/TR]
[TR]
[TD]efg[/TD]
[TD="align: right"]234[/TD]
[/TR]
[TR]
[TD]dfgw[/TD]
[TD="align: right"]469[/TD]
[/TR]
</tbody>[/TABLE]
Hope this is possible!
Dan
I'm normally pretty good a googling a solution for a VBA problem however this one has be stumped.
Recently, our IT department transitioned one data cube over to another. In this new Data Cube our SKUs are now assigned a value. This value though is not shown in any accessible field. I discovered the SKU to value relationship when I recorded a macro:
ActiveSheet.PivotTables("PivotTable1").PivotFields("[Item].[SKU].[SKU]").ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields("[Item].[SKU].[SKU]").CurrentPageName = "[Item].[SKU].&[2523]"
The code use to be:
ActiveSheet.PivotTables("PivotTable1").PivotFields("[Item].[SKU].[SKU]").ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields("[Item].[SKU].[SKU]").CurrentPageName = "[Item].[SKU].&[abcdefg]"
I'm wondering if anyone knows how to code a loop through each of the SKUs in the cube, then to copy the corresponding value to a reference table in a sheet.
Ideally like this:
[TABLE="width: 142"]
<tbody>[TR]
[TD]SKU[/TD]
[TD]VALUE[/TD]
[/TR]
[TR]
[TD]abc[/TD]
[TD="align: right"]123[/TD]
[/TR]
[TR]
[TD]efg[/TD]
[TD="align: right"]234[/TD]
[/TR]
[TR]
[TD]dfgw[/TD]
[TD="align: right"]469[/TD]
[/TR]
</tbody>[/TABLE]
Hope this is possible!
Dan