Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating Pivot-Tables
Hello everyone!
I have a very big doubt on how I can use Excel's Macro in order to update automatically my pivot-table. I already have a macro that "imports" the file when a button is pressed. I am not being sucessful, however, in updating the pivot table after importing the file. It already looks like this: Sub Import() Application.ScreenUpdating = False Application.EnableCancelKey = xlDisabled arqAAbrir = Application.GetOpenFilename() Workbooks.Open Filename:=arqAAbrir NomeArquivo = ActiveWorkbook.Name Range("A1:K9").Copy Windows("Compilador_Visitas.xls").Activate Dados.Visible = True Dados.Select Dados.Range("A" & Dados.Range("E1").Value).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Windows(NomeArquivo).Activate Application.DisplayAlerts = False ActiveWindow.Close VisaoGeral.Select Range("C4").Select ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:="Dados!R2C1:R" & Dados.Range("E1").Value - 1 & "C11" Dados.Visible = False Range("A1").Select Application.ScreenUpdating = True End Sub Does anyone know how to do this??? Thanks in advance for your help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating Pivot-Tables
I use the following code:
ActiveSheet.PivotTables(name of the pivot table).PivotCache.Refresh Hopefully it's of use to you. Good luck Ruud "Rafael Chang" schreef in bericht ... Hello everyone! I have a very big doubt on how I can use Excel's Macro in order to update automatically my pivot-table. I already have a macro that "imports" the file when a button is pressed. I am not being sucessful, however, in updating the pivot table after importing the file. It already looks like this: Sub Import() Application.ScreenUpdating = False Application.EnableCancelKey = xlDisabled arqAAbrir = Application.GetOpenFilename() Workbooks.Open Filename:=arqAAbrir NomeArquivo = ActiveWorkbook.Name Range("A1:K9").Copy Windows("Compilador_Visitas.xls").Activate Dados.Visible = True Dados.Select Dados.Range("A" & Dados.Range("E1").Value).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Windows(NomeArquivo).Activate Application.DisplayAlerts = False ActiveWindow.Close VisaoGeral.Select Range("C4").Select ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:="Dados!R2C1:R" & Dados.Range("E1").Value - 1 & "C11" Dados.Visible = False Range("A1").Select Application.ScreenUpdating = True End Sub Does anyone know how to do this??? Thanks in advance for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Updating Pivot Tables | Excel Discussion (Misc queries) | |||
Updating all pivot tables at once | Excel Worksheet Functions | |||
updating pivot tables | Excel Discussion (Misc queries) | |||
updating pivot tables | Excel Discussion (Misc queries) | |||
Updating Pivot Tables | Excel Programming |