Refresh PivotTables without Removing timeline

Macro_Nerd99

Board Regular
Joined
Nov 13, 2021
Messages
61
Office Version
  1. 365
I have a worksheet with several pivot tables that are connected to a timeline. However, when I click the "Refresh Pivot Tables" button that I created, the timeline is always deleted. How do I prevent this?

Here is the code connected to the button:
VBA Code:
Sub Refresh_btn_Click()
    Dim PC As PivotCache
        For Each PC In ActiveWorkbook.PivotCaches
            PC.Refresh
        Next PC
        
End Sub
       
Thanks.
[ATTACH type="full"]78076[/ATTACH]
 

Attachments

  • 1667845156994.png
    1667845156994.png
    36.5 KB · Views: 11

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Can you check the following:
1) Your time line heading is "Date". Is the column heading of the date field on which the time line is based still called "Date" ?
2) Does the Date column in the table contain any cells with a text value (including dates as text) or any cells with an error value ?
(Easiest way is probably to use a filter and in the filter drop down check for the text and error items which will most likely be at the very bottom)
 
Upvote 0

Forum statistics

Threads
1,215,018
Messages
6,122,703
Members
449,093
Latest member
Mnur

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