Hi everyone, I'm new in this forum and I rarely use vba, so my question could be very dumb.
I'm trying to get the parent item name of a clicked cell (e.g. when I double click on field "Commessa 2" I'd like to get "Region 3" and pass it to another sheet)
Here is my code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Worksheets("CE_YTD_3°liv").Cells(7, 11) = ActiveCell.PivotItem.ParentItem.Name
Worksheets("CE_YTD_3°liv").Activate
End Sub
When I run this code, I get the message "Unable to get the ParentItem property of the PivotItem class"
Any Idea to solve this?
Thanks
Bookmarks