|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
你没再次回复我,我收不到提醒
- Sub 按钮1_Click()
- Dim cho As ChartObject
- Dim sht As Worksheet
-
- Set sht = Worksheets("Sheet1")
-
- For Each cho In sht.ChartObjects
- cho.Delete
- Next
-
- With sht.ChartObjects.Add(200, 100, 400, 247).Chart
- .ChartType = xlColumnClustered
- .SetSourceData Source:=sht.Range("A1").CurrentRegion
- .Axes(Type:=xlCategory).TickLabels.Font.Color = RGB(255, 0, 0)
- .Axes(Type:=xlValue).TickLabels.Font.Color = RGB(255, 0, 0)
- End With
- End Sub
复制代码
用 chartobject.add 可以向上兼容到 2003版 |
|