Pivot Tables - refresh from Userform command button

  • Thread starter Thread starter Roger on Excel
  • Start date Start date
R

Roger on Excel

[Excel 2003]

I have a question regarding the activation of pivot table refreshes from a
userform.

I tried to use the following code in a command button without success:

ActiveSheet.PivotTables("PovotTableName").RefreshTable

I think the code doesnt work because the userform is in another
sheet to the pivot table, however I need this to be the case since I have 10
different sheets, each with a different pivot table.

Can anyone help ?
 
Roger,
Always worth looking in the VBA helpfile which gives good direction on both
questions.

Try following & see if helps:

Application.DisplayAlerts = False

Sheets("Piviot").PivotTables("PivotTable1").RefreshTable

Application.DisplayAlerts = True
 
Thanks John,

The code works very nicely,

All the best,

Roger

john said:
Roger,
Always worth looking in the VBA helpfile which gives good direction on both
questions.

Try following & see if helps:

Application.DisplayAlerts = False

Sheets("Piviot").PivotTables("PivotTable1").RefreshTable

Application.DisplayAlerts = True
--
jb


Roger on Excel said:
[Excel 2003]

I have a question regarding the activation of pivot table refreshes from a
userform.

I tried to use the following code in a command button without success:

ActiveSheet.PivotTables("PovotTableName").RefreshTable

I think the code doesnt work because the userform is in another
sheet to the pivot table, however I need this to be the case since I have 10
different sheets, each with a different pivot table.

Can anyone help ?
 
Back
Top