Cells.Find and PivotTables

N

Notaguru

I'm trying to use VBA and Cells.Find to search a Pivot Table; if found,
expand the details of that row.

As the fields are all collapsed, it finds items in the first column (A)
only. If I manually expand all fields it will find my search string.

Any suggestions?


Code:
Private Sub BtnFind_Click()
Dim partNumer As String

partNumber = TextPart.Value

Range("A1").Select

Cells.Find(What:=partNumber, After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

Selection.ShowDetail = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top