View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Notaguru Notaguru is offline
external usenet poster
 
Posts: 1
Default Cells.Find and PivotTables

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