Pivot Tables - refresh from Userform command button

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 ?
 
J

john

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
 
R

Roger on Excel

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 ?
 

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