ActiveSheet.PivotTables("PivotTable2").RefreshTable
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 04:59:40
ActiveSheet.PivotTables("PivotTable2").RefreshTable
ActiveSheet.PivotTables("PivotTable2").RefreshTable
ActiveSheet.PivotTables("PivotTable2").RefreshTable
只是一条Basic程序语言(Visual Basic for Applications),你找一个计算机方面的同学看看吧.
原文是:
15th Apr 2004
Hi all,
I am using Exel 97 and I am trying to put a macro together that
refreshes a pivot table after new data is inputted.The data and the
pivot table is in worksheet 1.The pivot table can change size depending
on the number of cells with data in it.I have set up a button (or
should I say Exel automatically set up a button) called
"CommandButton1".This links to the following VBA:
Private Sub CommandButton1_Click()
ActiveSheet.PivotTables("PivotTable2").RefreshTable
End Sub
When I press the button I receive the following message:
Run time error '1004':
RefreshTable method of PivotTable class failed.
I have looked up some older threads and it looks like I am inputting the
correct coding but obviously I am not.
Someone's assistance will be greatly appreciated.
刷新当前工作表中的名为“PivotTable2”的数据透视表。
refreshtable意思是数据刷新--activesheet意思是活动工作表,也是只当前工作表。双引号里面的是只当前工作表的表名。这句话的功能是只要是激活“PivotTable2”所在的工作表,数据就会自动刷新