我想通過Excel VBA在圖表中創建錯誤條,但是我需要寬度爲12PT或變化。下面是我使用的代碼,但它並不像它的工作:無法更改自定義錯誤條的寬度
Set s = .SeriesCollection.NewSeries()
With s
.Name = "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("Activity").Range.Column) & "$" & sourceRow
.XValues = "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("DateMid").Range.Column) & "$" & sourceRow
.Values = "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("Loc1").Range.Column) & "$" & sourceRow
.HasErrorBars = True
.ErrorBar Direction:=xlX, Include:=xlErrorBarIncludeBoth, Type:=xlErrorBarTypeCustom, Amount:="=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("BarLength").Range.Column) & "$" & sourceRow, MinusValues:="=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("BarLength").Range.Column) & "$" & sourceRow
Set eB = .ErrorBars
With eB
With .Format.Line
.Visible = msoTrue
.Style = msoLineSingle
.Weight = 12
End With
.EndStyle = xlNoCap
End With
.HasDataLabels = True
Set dLabels = .DataLabels
With dLabels
.Format.TextFrame2.TextRange.InsertChartField msoChartFieldRange, "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("Activity").Range.Column) & "$" & sourceRow
.ShowRange = True
.ShowSeriesName = False
.ShowValue = False
End With
End With
我想通使用權性質的工作,但沒有我忽略的東西嗎?
2010年適合我。你看到了什麼? – Rory
錯誤欄寬度是否爲12pt?這只是在4點左右對我來說。 – jDave1984
是的,是的。同樣在2016年。 – Rory