- 帖子
- 248
- 主題
- 55
- 精華
- 0
- 積分
- 314
- 點名
- 194
- 作業系統
- XP / WIN7
- 軟體版本
- 2003 / 2007
- 閱讀權限
- 20
- 性別
- 男
- 來自
- Tainan
- 註冊時間
- 2013-10-18
- 最後登錄
- 2026-10-30
             
|
chart VBA操作
最近在進行Chart的操作
不過依現有書籍好少相關的資料
一直上網GOOGLE
湊來湊去
以下是我目前用到的語法
下圖紅框裡面
菱形標記的框線寬度我一直查不到語法是什麼
用了這個.SeriesCollection(4).Format.Line.Weight
我是要用來調整走勢的曲線寬
不過他連標記的框線寬也跟著調整
不知只調標記的框線寬語法如何撰寫
還有~錄製巨集是否無法進行Chart操作的錄製???
使用了好幾次都只錄到Select、Activate之類的部分@@- .ChartTitle.Font.Size = 6.5 '標題字體大小
- .ChartTitle.Font.Name = "Arial" '標題字型
- .Legend.Position = xlLegendPositionBottom '圖例列底部
- .Legend.Top = 115 '圖例位移
- .SeriesCollection(4).Border.Color = 5066944 '線條顏色
- .SeriesCollection(4).Format.Line.Weight = 2 '線條寬為2
- .SeriesCollection(4).MarkerStyle = 2 '標記菱形
- .SeriesCollection(4).MarkerBackgroundColorIndex = 2 '標記顏色(白)
- .SeriesCollection(4).MarkerSize = 5 '標記大小5
-
- .SeriesCollection(4).ApplyDataLabels '顯示資料標籤
- .SeriesCollection(4).Select
- .SetElement (msoElementDataLabelTop) '資料標籤置上
-
- .Axes(xlValue, xlPrimary).AxisTitle.Font.Size = 6.5 'Y軸標題大小
- .Axes(xlValue, xlPrimary).AxisTitle.Font.Name = "Arial" 'Y軸標題字型
- .Axes(xlValue, xlPrimary).AxisTitle.Left = -3 'Y軸標題位移
- .Axes(xlCategory).TickLabels.Font.Size = 5 'X軸字體大小
- .Axes(xlCategory).TickLabels.Font.Name = "Arial" 'X軸字型
-
- .Axes(xlValue).TickLabels.Font.Size = 6.5 'Y軸字體大小
- .Axes(xlValue).TickLabels.Font.Name = "Arial" 'Y軸字型
-
- .Legend.Font.Size = 6.5 '圖例字體大小
- .Legend.Font.Name = "Arial" '圖例字型
-
- .SeriesCollection(4).DataLabels.Font.Size = 5 '上列數值字體大小
- .SeriesCollection(4).DataLabels.Font.Name = "Arial" '上列數值字型
複製代碼
P.S.
另外想請問各位大大程式概念像以下
.Legend.Font.Size = 6.5的Lengend
.TickLabels.Font.Size = 5 的TickLabels以專業說法都是指"屬性"嗎??? |
|