quick Q. i dont want excell to ask me...

uveenhacked

New Member
Joined
Nov 18, 2005
Messages
28
how can i automatically refresh my pivot table, acctually i made a button for it, and assign this,

Sub Refresh_pivot()
ActiveSheet.PivotTables("PivotTable4").PivotCache.Refresh
ActiveSheet.PivotTables("PivotTable3").PivotCache.Refresh
ActiveSheet.PivotTables("PivotTable2").PivotCache.Refresh
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
End Sub

but excell always ask me this:

do you want to replace the contents of the destination cells in (worksheet name)?

i dont want excel do ask me... what should i do?

thanks in advance.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
hello Tazguy37, i can't use refresh all cause i have a code that stamp dates automatically (hardcode). but when ever i use refresh all, all dates are refreshed. thats why i have to refresh pivots only.
 
Upvote 0
Perhaps add:

Code:
Application.DisplayAlerts = False
to the beginning of your code, and
Code:
Application.DisplayAlerts = True
to the end.
 
Upvote 0
Maybe you can sandwich your code in between

Application.displayalerts = False
Your code
Application.displayalerts = True


or
Application.AlertBeforeOverwriting = False
YourCode
Application.AlertBeforeOverwriting = True


I keep my Tools > Options setting on the Edit tab for that set to False, hate seeing that message also, macro or not.
 
Upvote 0

Forum statistics

Threads
1,203,428
Messages
6,055,325
Members
444,780
Latest member
jtfish

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top