Farias_10a
New Member
- Joined
- Jun 25, 2020
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
Hi To all,
I am kind of new working with OLEP Cube, I Record a Macro with Macro Recorder that works nice, but I need to substitute a Value with an User Entry,
This is the original Code that I have that works Fine
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Profit Center].[Profit Ctr Rptg].[Profit Ctr Lvl]").ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Profit Center].[Profit Ctr Rptg].[Profit Ctr Lvl]").CurrentPageName = _
"[Profit Center].[Profit Ctr Rptg].&[US01562]"
I need to substitute the part of US01562, with a User entry or with a Cell selection, I have read a lot of postings on the net but I cant find the solution
Here is what I have at the moment with the current research but this code give me object error
Dim ProfitCenter As String
Dim Dato As String
Dato = InputBox("Select profit Center")
If Dato = "" Then Exit Sub
ProfitCenter = "[Profit Center].[Profit Ctr Rptg].&[" & Dato & "]"
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Profit Center].[Profit Ctr Rptg].[Profit Ctr Lvl]").ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Profit Center].[Profit Ctr Rptg].[Profit Ctr Lvl]").VisibleItemsList = ProfitCenter
thanks in advance
I am kind of new working with OLEP Cube, I Record a Macro with Macro Recorder that works nice, but I need to substitute a Value with an User Entry,
This is the original Code that I have that works Fine
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Profit Center].[Profit Ctr Rptg].[Profit Ctr Lvl]").ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Profit Center].[Profit Ctr Rptg].[Profit Ctr Lvl]").CurrentPageName = _
"[Profit Center].[Profit Ctr Rptg].&[US01562]"
I need to substitute the part of US01562, with a User entry or with a Cell selection, I have read a lot of postings on the net but I cant find the solution
Here is what I have at the moment with the current research but this code give me object error
Dim ProfitCenter As String
Dim Dato As String
Dato = InputBox("Select profit Center")
If Dato = "" Then Exit Sub
ProfitCenter = "[Profit Center].[Profit Ctr Rptg].&[" & Dato & "]"
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Profit Center].[Profit Ctr Rptg].[Profit Ctr Lvl]").ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Profit Center].[Profit Ctr Rptg].[Profit Ctr Lvl]").VisibleItemsList = ProfitCenter
thanks in advance