Select Value on OLEP Cube

Farias_10a

New Member
Joined
Jun 25, 2020
Messages
1
Office Version
  1. 365
Platform
  1. 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
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top