ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Refresh pivot data automation (https://www.excelbanter.com/excel-programming/425840-refresh-pivot-data-automation.html)

Cam

Refresh pivot data automation
 
Hello,

I have an excel file with several pivot sheets (from source Access query)
that I need to refresh the data once a day every 6:30AM. I was able to create
a scheduler task in Windows XP to open the file at 6:30AM every morning, but
I need to run the refresh all macro in the excel file instead. How do I
program in VBA or how to do what I want? Thanks

Also, I want in the sheets to show date/time stamp of when the data was
refresh. Don't know how.

ryguy7272

Refresh pivot data automation
 
For Refresh all Pivot Tables in a Worksheet, see this:
http://www.ozgrid.com/VBA/pivot-table-refresh.htm

Now, for the time stamp, just do something like this:
Sub Macro1()
Range("J1").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Range("J1").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub

Well, you get the idea.

HTH,
Ryan---

"Cam" wrote:

Hello,

I have an excel file with several pivot sheets (from source Access query)
that I need to refresh the data once a day every 6:30AM. I was able to create
a scheduler task in Windows XP to open the file at 6:30AM every morning, but
I need to run the refresh all macro in the excel file instead. How do I
program in VBA or how to do what I want? Thanks

Also, I want in the sheets to show date/time stamp of when the data was
refresh. Don't know how.



All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com