vbscript 调整PowerPoint图表的数据标签

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vbscript 调整PowerPoint图表的数据标签相关的知识,希望对你有一定的参考价值。

Sub TweakDataLabelsPPTChart()

'--------------------------------------------------
' Changes Data Labels at a click for PPT
' At the moment works best for a simple bar chart
' More flexible variations of this macro to follow
'--------------------------------------------------
Dim i, j As Long
Dim shp1 As Shape

Set shp1 = ActiveWindow.Selection.ShapeRange(1)
i = 1
j = shp1.Chart.FullSeriesCollection.Count
Debug.Print j

For i = 1 To j
    shp1.Chart.FullSeriesCollection(i).DataLabels.Font.Color = RGB(75, 190, 170) 'Change required colour here
    shp1.Chart.FullSeriesCollection(i).DataLabels.Position = xlLabelPositionOutsideEnd 'Change required label position here
Next

End Sub

以上是关于vbscript 调整PowerPoint图表的数据标签的主要内容,如果未能解决你的问题,请参考以下文章

vbscript 调整演示文稿[PowerPoint VBA]中的所有图表的大小和重新定位

vbscript 更改PowerPoint图表中散点图上所有点的颜色

vbscript 在PowerPoint中调整散点图的标签

vbscript 在PowerPoint中调整散点图的标签

vbscript [创建表格图例]在PowerPoint #PowerPoint中创建一行迷你表格图例

更改 PowerPoint 直方图图表中图表标题的文本颜色