View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
bowka bowka is offline
external usenet poster
 
Posts: 1
Default Retrieve pivotitem range

I am trying to retrieve the cell which contains the pivotitem. I am trying to
do this using datarange. But everytime i try to the run the following code,
it gives an "Application defined or Object defined error" .

I tried debugging and it states that the application is unable to find the
datarange. No idea why this happens. Is there a way around this to find the
range.



Code

Function returnIL5Cell(ByVal plitem As PivotField) As Range

Dim rng As Range
Dim pl As PivotItem

Set pl = plitem.PivotItems(2)
rng = pl.DataRange.select

response = MsgBox(rng.Value, vbOKCancel)

End Function


thanks & regards,

Nikhil.