我正在尝试在数据透视表中使用.autoshow方法,但每次都会收到“1004”错误消息。我试图在Excel 2011 for mac下使用它。我不确定这个方法是否适用于我的Excel版本,有人可以帮忙吗?
以下是我一直在处理的程序
ActiveSheet.PivotTables(1).PivotFields("City").AutoShow Top:=xlAutomatic, Range:=xlTop, _ Count:=6, Field:="Digital channel"
源表看起来像这样(我缩短了它,它实际上有91行)
+-----------------+-----------------+------------+ | City | Digital channel | Callsign | +-----------------+-----------------+------------+ | Baie-Saint-Paul | 13,00 | CIMT-DT-4 | | Baie-Saint-Paul | 26,00 | CFTF-DT-10 | | Baie-Saint-Paul | 36,00 | CKRT-DT-1 | | Baie-Comeau | 9,00 | CFTF-DT-5 | | Baie-Trinité | 12,00 | CIVF-DT | | Cabano | 12,00 | CFTF-DT-3 | | Cabano | 21,00 | CKRT-DT-4 | | Cabano | 23,00 | CIMT-DT-8 | | Carleton | 44,00 | CFTF-DT-11 | | Carleton | 5,00 | CHAU-DT | | Carleton | 15,00 | CIVK-DT | | Chandler | 26,00 | CHAU-DT-4 | | Chapeau | 23,00 | CIVP-DT | | Chicoutimi | 46,00 | CJPM-DT | | Cloridorme | 11,00 | CHAU-DT-8 | | Dégelis | 25,00 | CKRT-DT-2 | | Forestville | 4,00 | CFTF-DT-4 | +-----------------+-----------------+------------+
枢轴表看起来像这样
+-------------------+-----------------+ | City | Digital channel | +-------------------+-----------------+ | Baie-Comeau | 9 | | Baie-Saint-Paul | 75 | | Baie-Trinité | 12 | | Cabano | 56 | | Carleton | 64 | | Chandler | 26 | | Chapeau | 23 | | Chicoutimi | 46 | | Cloridorme | 11 | | Dégelis | 25 | | Forestville | 4 | | Gascons | 32 | | Gaspé | 71 | | Gatineau | 104 | | Grand-Fonds | 31 | | L'Anse-a-Valleau, | 12 | | Les Escoumins | 68 | | Montreal | 263 | | Parent | 0 | | Percé | 53 | | Port-Daniel | 10 | | Quebec City | 113 | | Radisson | 0 | | Rimouski | 105 | | Rivière-au-Renard | 4 | | Rivière-du-Loup | 110 | | Roberval | 0 | | Rouyn-Noranda | 50 | | Saguenay | 79 | +-------------------+-----------------+
谢谢!