pivot-chart

How to debug a Pivot Chart Macro?

不羁岁月 提交于 2020-01-04 07:44:49
问题 I am not able to run this, I want to count total rows in sheet and pass that to pivot chart to create. Pivot chart create select fileds Double click grand total to create new spread sheet Sub Macro2() Dim ws As Worksheet Dim lastRow As Long Set ws = ActiveSheet NewSheet = ActiveSheet.Name lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _ ws & "!R1C1:R" & lastRow & "C15", Version:=xlPivotTableVersion14)

Python win32com PivotCache.CreatePivotChart() error: 'Exception occurred'

﹥>﹥吖頭↗ 提交于 2019-12-13 03:45:38
问题 There is one other question from Sep 2017 that addresses this same problem but does not have an answer: create a pivotchart with python win32com I have tried several approaches to get this working so I want to explain these and hopefully get some insight from someone on how to get this working. This does not appear to be a well worn path so I do not have high hopes. Environment details: Windows 10 Office 2013 Anaconda 3.6 I use win32com.client.gencache.EnsureDispatch('Excel.Application') but

Pivot chart cumulative (running in) distinct count

橙三吉。 提交于 2019-12-13 03:16:57
问题 I need to create pivot chart (it is supposed to be pivot for the sake of very convenient filtering and efficiency but anything equivalent could do) showing cumulative distinct count. For example I have a data set: Month ¦ Drink brand ¦ Drink type -------------------------------- 1 ¦ Abc ¦ Water 1 ¦ Def ¦ Soft 1 ¦ Abc ¦ Water 1 ¦ Ghi ¦ Soft 1 ¦ Xyz ¦ Water 2 ¦ Abc ¦ Water 2 ¦ Abc ¦ Water 2 ¦ Jkl ¦ Soft 2 ¦ Opq ¦ Soft 2 ¦ Abc ¦ Water And from this I would like to get a chart: ¦ Drink ¦ type ¦ S

create a pivotchart with python win32com

依然范特西╮ 提交于 2019-12-12 09:49:49
问题 is there anyone can give a example code for creating a pivotchart in excel? I have got an example to create a pivottable with pivottable, it works , while when I try to create a pivotchart in the same ways, it will always failed! import win32com.client import os Excel = win32com.client.gencache.EnsureDispatch('Excel.Application') win32c = win32com.client.constants wb = Excel.Workbooks.Add() Sheet1 = wb.Worksheets.Add() TestData = [['Country','Name','Gender','Sign','Amount'], ['CH','Max' ,'M',

Pivot Chart series color based on row fields

折月煮酒 提交于 2019-12-10 20:23:41
问题 New to pivot charts and their associated vba. But I'm attempting to change the colours of my bar graph depending on which province they belong to. I've been unable to use conditional formatting in a chart so I attempted a macro. Since I can't upload pictures my table looks a bit like this: Prov/Name/Period/Value ON: Name1, Dec14, 100 Name2, Dec13, 200 BC: Name1, Dec14, 400 Name2, Dec13, 600 SK: Name1, Dec14, 100 Name2, Dec13, 2000 My pivot chart displays this data in a bar graph with each bar