vba以表格形式显示数据透视表 [英] vba to show pivot table in tabular form

查看:570
本文介绍了vba以表格形式显示数据透视表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个vba,以表格形式显示活动单元格中的数据透视表,但它不能正常工作

I'm trying to write a vba to show the pivot table in the active cell in tabular form and it's not working

Sub TABULAR_TABLE()

Dim PVT As PivotTable
Set PVT = ActiveCell.PivotTable
   
   ActiveSheet.PivotTables("PVT").RowAxisLayout xlTabularRow
   ActiveSheet.PivotTables("PVT").RepeatAllLabels xlRepeatLabels
    
End Sub




 


 

推荐答案

取代ActiveSheet 数据透视表 " PVT" ),使用PVT:

   PVT RowAxisLayout xlTabularRow

   PVT
RepeatAllLabels xlRepeatLabels

   PVT.RowAxisLayout xlTabularRow
   PVT
.RepeatAllLabels xlRepeatLabels


这篇关于vba以表格形式显示数据透视表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆