0
Dim LastRow As Long
Dim Rng1 As Range
Dim ShName As String
With ActiveSheet
LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
Set Rng1 = .Range("A2:E" & LastRow)
ShName = .Name
End With
Charts.Add
With ActiveChart
.ChartType = xlLine
.HasTitle = True
.ChartTitle.Text = "CPU Utilization"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Duration of Run(hh:mm)" 'X axis name
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "CPU Utilization (%)" 'y-axis name
.Legend.Position = xlLegendPositionBottom
.SetSourceData Source:=Rng1
.Location Where:=xlLocationAsObject, Name:=ShName
End With
我想在上面的代碼中,我試圖下面的代碼,但did'nt工作(的方法或數據未找到錯誤)在Excel VBA中獲取的NumberFormat
.NumberFormat = "[$-F400]h:mm:ss AM/PM"
.NumberFormat = "h:mm;@"
也希望設置的寬度和高度的NumberFormat添加的圖形並在格式軸上添加千個顯示單位。請。爲此提供解決方案。