Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Hello I have a code which works great. However, because my primary pivot table is unlocked and re-locked with the following code it doesn't extend to another worksheet where the final results will reside. The other worksheet is "Data Records" I would like this to apply to. It is on a private sub due to this being on a User Form which where the Cmd button is.
Thank you,
Thank you,
VBA Code:
Private Sub CmdRefresh_click()
Call Reset
Dim xpt As PivotTable
With ActiveSheet
.Unprotect Password:="mozzer"
For Each xpt In .PivotTables
xpt.RefreshTable
Next xpt
.Protect Password:="mozzer", _
AllowUsingPivotTables:=True
End With
End Sub