ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cells.Find and PivotTables (https://www.excelbanter.com/excel-programming/416625-cells-find-pivottables.html)

Notaguru

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


All times are GMT +1. The time now is 03:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com