Retrieve Value from a PageField
Don't know if you can get only the last part with any property of the
PivotTable, but parsing out would be easy:
PageSelected = PT.PageFields(i).CurrentPageName
PageSelected = Right(PageSelected,
Len(PageSelected)-InStrRev(PageSelected,"."))
"kf" wrote:
I have a pivot table in Excel based on an OLAP cube. I need to cycle
through the rows, columns and page fields to determine what (if
anything) the user has selected.
I've successfully done this for rows and columns but not for page
fields. I'm using the following code:
PT.PageFields(i).CurrentPageName (PT is a PivotTable object)
This returns the following:
[Category].[All Category].[Books]
I only want to return "Books". Aside from parsing it out, is there a
way to return only that portion of the page field name?
|