I have a pivotTable that has a pivotfield in Columns "A" and "B". The pivotdata starts in Column "C." Is there a line of code to make vba show the detail (in column C) of a specific pivot item (in either columns A or B)? I am currently using the .Find(...) to find the item (as well as application.goto to go to the found cell), then using the activecell.row and then concatenating this with "C" to get the data cell's reference then showing the detail on this cell. (See code below)
I was wondering if there was a more effecient way to do this. Thanks in advance.
Code:
With .Columns(strColLookup)'strColLookup is either "A:A" or "B:B"
Set rngFound = .Find(What:=strLineDescr, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
End With
If Not rngFound Is Nothing Then
varFRow = Range(rngFound.Address).Row
.Range("C" & varFRow).ShowDetail = True
End If
I was wondering if there was a more effecient way to do this. Thanks in advance.