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添加的图形并在格式轴上添加千个显示单位。请。为此提供解决方案。