Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default PLEASE HELP** Pivot table auto updating

I created a macro to run a SQL and return the data, then in excel there are
calculations being performed. Based on these calculations, I create a pivot
table. How can I have the pivot table update automatically everytime I run
the report?
This is what I have so far...........

Sheets("OOS").Select
ActiveWindow.SmallScroll Down:=-3
Cells.Select
Selection.Copy
Sheets("Pivot").Select
Cells.Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Buttons.Add(2328.75, 5.25, 129.75, 21.75).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Rows("1:6").Select
Range("A6").Activate
Selection.Delete Shift:=xlUp
Range("B2").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"Pivot!R1C2:R122C16").CreatePivotTable TableDestination:="",
TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="UW", _
ColumnFields:="Workbasket"
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("OOS Days")
.Orientation = xlDataField
.Caption = "Count of OOS Days"
.Function = xlCount
End With
ActiveWorkbook.ShowPivotTableFieldList = False
Columns("A:A").ColumnWidth = 9.43
Columns("B:B").ColumnWidth = 12.14
Columns("C:C").ColumnWidth = 13
Range("B4").Select


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default PLEASE HELP** Pivot table auto updating

You need this line in your macro.
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh
You can record it by clicking on the Pivot tabel and refresh ! it.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating auto Updating Pivot Table linked to external data. mike Excel Discussion (Misc queries) 1 February 26th 08 06:28 PM
updating pivot table GeorgeJ Excel Discussion (Misc queries) 1 December 6th 07 07:21 PM
Auto updating a table phil2006 Excel Discussion (Misc queries) 1 June 7th 06 06:08 PM
Auto updating pivot tables using external XML data serdar New Users to Excel 0 March 12th 06 07:29 AM
Pivot Table not Updating Ranelle Excel Worksheet Functions 0 June 13th 05 05:13 PM


All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"