我一直在非常努力地修复数据标签的数据类型格式。不幸的是,什么都没有解决。我希望数据标签的格式为0.00%。我该如何更改?
这是程序中的示例。
Dim OAPList As Range
Dim SingleCell As Range
Dim Counter As Integer
Set OAPList = Worksheets("Sheet2").Range("E2:E" & lw)
activeChart.FullSeriesCollection(1).ChartType = xlColumnClustered
activeChart.FullSeriesCollection(1).AxisGroup = 1
activeChart.SeriesCollection(1).HasDataLabels = True
Counter = 1
With activeChart.SeriesCollection(1)
For Each SingleCell In OAPList
activeChart.SeriesCollection(1).Points(Counter).DataLabel.Text = SingleCell.Value
Counter = Counter + 1
Next SingleCell
.DataLabels.ShowValue = True
.DataLabels.NumberFormat = "0%"
'.DataLabels.Position = xlLabelPositionInsideEnd
.DataLabels.Format.AutoShapeType = msoShapeRectangularCallout
.DataLabels.Format.Line.Visible = msoTrue
End With
activeChart.SeriesCollection(2).Name = "Estimated Hours"
activeChart.FullSeriesCollection(2).ChartType = xlColumnClustered
activeChart.FullSeriesCollection(2).AxisGroup = 1